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

Assertions in cs_tests/recur4.c cannot be reachable due to non-terminating function call? #23

Open
taquangtrung opened this issue Nov 17, 2020 · 2 comments

Comments

@taquangtrung
Copy link

Hi,

For this test case, I think that the first two assertions cannot be reached, since f(p) is non-terminating for the if-then case.

Could you advise if these assertions should be removed, or the first function call f(p) should be removed alternatively?

// cs_test/recur4.c

#include "aliascheck.h"

int **x, *y;
int z;
void f(int **p);
void main(){
	x = &y;
	f(x);
}


void f(int **p){
	int k;
	y = &k;
	if (z){
		f(p);
		*p = &z;
		__assert_must_alias(y,&z);
		__assert_no_alias(y,&k);
		f(p);
	}
	/// y will not alias to &z as the value flow
	/// of y after it is updated at "*p=&z" will
	/// flow into f(p) again and then be updated
	/// by the first statement "y=&k".
	__assert_no_alias(y,&z);
	__assert_may_alias(y,&k);

}
@yuleisui
Copy link
Collaborator

I am removing the first function call f(p)

@taquangtrung
Copy link
Author

Thank you for the update!

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