secure-software-engineering / phasar

A LLVM-based static analysis framework.
Other
940 stars 142 forks source link

taint-analysis not working in PhASAR #440

Closed devanshrajgarhia closed 2 years ago

devanshrajgarhia commented 2 years ago

I have been trying to get the taint analysis working on the test code given in phasar/build/test/llvm_test_code/taint_analysis/dummy_source_sink

extern int source();     // dummy source
extern void sink(int p); // dummy sink
int main(int argc, char **argv) {
    int a = source();
    sink(a);
    return 0;
}

I have used the llvm IR in the build folder and compiled with phasar-llvm -m taint_01_cpp_m2r_dbg.ll -D ifds-taint --analysis-config ~/phasar/config/phasar-source-sink-function.json -S but I get :

A LLVM-based static analysis framework

Module taint_01_cpp_m2r_dbg.ll:
> LLVM IR instructions: 6
> functions:        5
> global variables: 0

----- Found the following leaks -----
No leaks found!

Is this a bug ? I have tried with other test files too but everytime I get no leaks found.

EDIT : used ide-xtaint instead of ifds-taint. It worked absolutely fine.