-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
Hi,
For this cs_test/cs9.c, I think that the assertion MUSTALIAS(d,&obj) should be MAYALIAS only?
This is because d isn't be involved in the if-then branch if(t) {c=&obj; x =&c; y =&e;}, hence d cannot be an alias of &obj.
Could you advise if my understanding is correct?
Best regards,
Trung.
#include "aliascheck.h"
int obj, t,s;
int *k =&s;
void foo(int**, int**);
main(){
int **x, **y;
int *a, *b, *c, *d,*e;
a = &t;
x=&a; y =&b;
foo(x,y);
NOALIAS(a,b);
MUSTALIAS(b,&obj);
*b = 5;
c=&t;
c=&s;
a=c;
MUSTALIAS(a,c);
if(t) {c=&obj; x =&c; y =&e;}
else { x= &d; y = &d;}
e = &t;
foo(x,y);
MAYALIAS(c,d);
MUSTALIAS(d,&obj); /// This should be MAYALIAS?
MAYALIAS(a,c);
NOALIAS(a,d);
MAYALIAS(c,d);
*e = 10;
}
void foo(int **p, int **q){
*p = *q;
*q = &obj;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels