You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;
}
The text was updated successfully, but these errors were encountered:
Hi,
For this
cs_test/cs9.c
, I think that the assertionMUSTALIAS(d,&obj)
should be MAYALIAS only?This is because
d
isn't be involved in theif-then
branchif(t) {c=&obj; x =&c; y =&e;}
, henced
cannot be an alias of&obj
.Could you advise if my understanding is correct?
Best regards,
Trung.
The text was updated successfully, but these errors were encountered: