Skip to content

Unable to run context-sensitive pointer analysis #1784

@theeshaan

Description

@theeshaan

I wish to run context-sensitive pointer analysis using SVF. However, I am unable to find the way to do so even after looking at the wiki.

Currently I am trying to run Demand-Driven Points-To analysis, as follows:

"$LLVM_PATH/opt" -S -passes='internalize,globaldce' -internalize-public-api-list=main $filepath.bc -o $filepath.opt.bc
"$SVF_PATH/dvf" -query=all -cpts -cxt -print-all-pts -dump-callgraph $filepath.opt.bc > $filepath.pta`

The documentation states that the -cxt flag enables Demand-driven context- flow- sensitive analysis, but on analyzing the following program:

#include <iostream>

struct Obj {
    int value;
};

Obj* id(Obj* p) {
    // Identity function
    return p;
}

int main() {
    Obj a;
    Obj b;

    Obj* pa = id(&a);  // Call context 1
    Obj* pb = id(&b);  // Call context 2

    return 0;
}

The SVF output reports that pa points to {a,b}, which is context-insensitive output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions