SVF-tools / Test-Suite

PTABen: Micro-benchmark Suite for Pointer Analysis
70 stars 38 forks source link

The assertion MUSTALIAS(m, n) in basic_c_test\CI-funptr.c should be MAYALIAS only? #34

Open taquangtrung opened 3 years ago

taquangtrung commented 3 years ago

Hi,

For this example, I think that in the first call to f, we have pa = &a and pb = &b, hence pa and pb are not aliases. Therefore, the MUSTALIAS assertion inside f doesn't hold for the first call to f.

Could you advise if it should be changed to MAYALIAS?

Thank you!

#include "aliascheck.h"

void f(int *m, int *n)
{
  MUSTALIAS(m, n);
}

typedef void (*fp)(int*m, int*n);

int main()
{
  int a,b,c,d;
  int *pa, *pb;
  fp p;
  pa = &a, pb = &b;
  f(pa, pb);                                            // pa and pb are not alias in this call.

  p = f;
  pb = &a;
  (*p)(pa, pb);

  return 0;
}
yuleisui commented 3 years ago

Done, thanks