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

Two MAYALIAS in cs_tests/recur8.c should be NOALIAS? #26

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

Two MAYALIAS in cs_tests/recur8.c should be NOALIAS? #26

taquangtrung opened this issue Nov 18, 2020 · 3 comments

Comments

@taquangtrung
Copy link

Hi,

For the two MAYALIAS in this test case, I think they should be NOALIAS?

This is because c and &b are aliases, and b, z1, z2 are variables declared differently, hence &b, &z1, &z2 cannot be aliases?

Could you advise if my understanding is correct?

// cs_tests/recur8.c

#include "aliascheck.h"
int z1,z2;
void foo(int **p);
void bar(int **a){
	int *c, b;
	*a = &b;
	c = *a;
	MUSTALIAS(c,&b);
	MAYALIAS(c,&z1);   // it should be no-alias if strong updates are enabled
	MAYALIAS(c,&z2);
	foo(a);
}


void foo(int** p){
	p = malloc(10);
	*p = &z2;
	bar(p);
}

int main(){
	int **x, *y;
	x = &y;
	y = &z1;
	foo(x);
}
@yuleisui
Copy link
Collaborator

Ideally, yes. but again, this is a conservative case, since heap strong updates are not enabled by the underlying analysis.

@taquangtrung
Copy link
Author

Hi again,

I'm working on a flow-sensitive analysis technique. For this program, it is non-terminating due to the recursive call of foo and bar, and my analysis tool doesn't terminate as well. Could you advise if this test case can be fixed? E.g., by adding a base case to the recursive call?

Thank you!

@yuleisui
Copy link
Collaborator

Just done by adding a termination condition: e622672

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