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

DSA: create formals from input params rather than CFG #295

Open
sadrabt opened this issue Jan 13, 2025 · 0 comments
Open

DSA: create formals from input params rather than CFG #295

sadrabt opened this issue Jan 13, 2025 · 0 comments

Comments

@sadrabt
Copy link
Contributor

sadrabt commented Jan 13, 2025

DSA currently traverses each proc's cfg using the intra-procedural iterator and creates formals for each variable which was not previously defined in the this proc

Instead used formalInParam (this is useful if a new type of statement is added)

The program below will cause a failed assertion in DSA in main if comiled with -O2 since c will only be in assume statements

long x;
long y;
long z;

__attribute((noinline)) int f(int a, int b, int c) {
    y = a + b;
    if (c) {
        x = b;
        return a;
    } else {
        x = a;
        return b;
    }
}

int main(int argc, char **argv) {
    x = f(x, 1, 0);
    return 0;
}

This branch addresses the issue

@sadrabt sadrabt changed the title DSA: create formals from rather than CFG formal paramters DSA: create formals from input params rather than CFG Jan 13, 2025
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

1 participant