Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possile incorrect assertion in cs_tests/cs21.c? #21

Open
taquangtrung opened this issue Nov 16, 2020 · 3 comments
Open

Possile incorrect assertion in cs_tests/cs21.c? #21

taquangtrung opened this issue Nov 16, 2020 · 3 comments

Comments

@taquangtrung
Copy link

Hi,

For the test case cs_tests/cs21.c, I believe the assertion MUSTALIAS inside the function foo should be only MAYALIAS.

This is because the function foo is non-terminating in the if-then case (in the function call foo(z): z==x).
Hence, the return statement can never be reached, therefore, we cannot say that y and &a are must-alias.

Could you advise if my understanding is correct?

// cs_tests/cs21.c

#include "aliascheck.h"
int a;
int *foo(int *x){
   int*z = x;
   int* y;
   if(x)
    y = foo(z);
   else
    y = x;

    MUSTALIAS(y,&a);             // this should be MayAlias, since `foo` is non-terminating in the if-then case.
    return y;
}

int main(){
 int*p;
 p = &a;
 foo(p);
}
@yuleisui
Copy link
Collaborator

Yes, correct. Would you mind submitting a pull request or you want me to change it?

Thanks,

@taquangtrung
Copy link
Author

Hi, thanks for the quick reply.
Could you please change it?
I think that will be more convenient for you.

@yuleisui
Copy link
Collaborator

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants