SVF-tools / Test-Suite

PTABen: Micro-benchmark Suite for Pointer Analysis
70 stars 38 forks source link

The EXPECTEDFAIL_NOALIAS in `cs_tests/recur9.c` should be NOALIAS? #28

Open taquangtrung opened 3 years ago

taquangtrung commented 3 years ago

Hi,

In this test case, I think the assertion EXPECTEDFAIL_NOALIAS(b,&b1) should be NOALIAS(b,&b1)?

It is very similar to the assertion NOALIAS(c,&c1), which I think is correct.

// cs_tests/recur9.c

#include "aliascheck.h"
int z;
void foo(int **a);
void bar(int **q){
    int** a = malloc(10);
    foo(a);
}

void foo(int **a){
    *a = &z;
    bar(a);
}

int main(){
    int** a,*b,*c,b1,c1;
    b = &b1;
    a = &b;
    foo(a);
    MUSTALIAS(b,&z);
    EXPECTEDFAIL_NOALIAS(b,&b1);
    a = &c;
    foo(a);
    MUSTALIAS(c,&z);
    NOALIAS(c,&c1);
}
yuleisui commented 3 years ago

Conservative underlying analysis could be improved.

taquangtrung commented 3 years ago

Do you suggest that both EXPECTEDFAIL_NOALIAS and NOALIAS are acceptable for b and &b1?

taquangtrung commented 3 years ago

Hi again,

Sorry for bothering you a lot this morning. I think this test case also needs to be fixed for the non-terminating recursive call...

Thank you a lot again for fixing them! :-)

yuleisui commented 3 years ago

Done and thank you~ f8ac87128bd29fc281ea96cf13b3307fa0808385

taquangtrung commented 3 years ago

For a quick update, when a base case is added to foo, I think the two assertions MUSTALIAS will become MAYALIAS (when the call to foo terminates immediately at the base case).

How do you think about it?

yuleisui commented 3 years ago

Yes, correct. However, for current SVF's flow-sensitive implementation, we did not distinguish MAY and MUST for now. For your usage purposes, I have changed it.

taquangtrung commented 3 years ago

Thank you very much! :-)