Comments (9)
Hello,
1) Using an existing pointer analysis.
The following gives you the most intuitive way to get the results of a flow-insensitive and field-sensitive pointer analysis (Andersen's analysis)
AndersenWaveDiff* ander = AndersenWaveDiff::createAndersenWaveDiff(svfModule);
ander->getPts(NodeID)
NodeID here represents a node (pointer variable) on PAG (refer to our wiki at https://github.com/SVF-tools/SVF/wiki/Technical-documentation#12-program-assignment-graph-pag).
Every pointer operand of an instruction (e.g., store or load) maps to a PAG Node. "ander->getPts(NodeID)" return a set of objects corresponding to LLVM allocation sites (Alloca, Global or heap allocations).
You may also wish to refer this thread in creating and using pointer analysis for indirect calls
#37
2) Writing a pointer analysis
You can create a new cpp file under the folder of "lib/WPA" and follow the following wiki to create a pointer analysis of your own.
https://github.com/SVF-tools/SVF/wiki/Write-a-flow--and-field---insensitive-pointer-analysis
from svf.
Thank you@yuleisui
from svf.
I am wondering if AndersenWaveDiffWithType is more precise than AndersenWave and FlowSensitive. I used these to check if an operand in LLVM IR can point to a heap memory object (at least one heap object in its points-to set). With AndersenWaveDiffWithType I got much less such operands. This is unexpected to me. I don't know where I am wrong.
from svf.
Yes, AndersenWaveDiffWithType is more precise given the type information is correctly reflected on LLVM IR.
from svf.
Do you mean it may not be conservative?
from svf.
Type information in C is OK so far. However, for C++, LLVM may not reflect the correct type information for classes since all types will be flattened base on bits after lowing IR.
Take a look at this: http://lists.llvm.org/pipermail/llvm-dev/2016-May/100139.html
Have you found any issue using AndersenWaveDiffWithType?
from svf.
I used it to check if an operand may point to a heap object for bzip2 (if its points-to set contains at least one heap object). If I use FlowSensitive PTA, I get 3848 such operands. But if I use AndersenWaveDiffWithType PTA, I only get 269 such operands. Such a reduction is not very reasonable to me. So I am wondering it is really conservative?
from svf.
You may wish to use the default AndersonWaveDiff solver. The diffWaveAnderseWithType is a new solver particularly for C++. It may not be converative as explained.
from svf.
OK. Thanks for explanation!
from svf.
Related Issues (20)
- dot graph generation: limit label lengths HOT 1
- question: missing edges in ICFG with function pointers HOT 3
- Mapping Analysis Results to Source Code HOT 3
- Saber Analysis for Object Fields HOT 4
- Question: Trying to add an indirect edge to a PTACallGraph
- Doxygen is significantly outdated with many versions behind. HOT 2
- Question: how to get the basic instruction? HOT 3
- ld: Undefined symbols building with BUILD_SHARED_LIBS HOT 8
- Question: why there is two different function definition for getSVFFunction? HOT 5
- Question: How to approach : Graphs/ICFG.cpp:189: SVF::CallBlockNode* SVF::ICFG::getCallBlockNode(const Instruction*): Assertion `SVFUtil::isCallSite(inst) && "not a call instruction?"' failed. HOT 7
- loop does not terminate in debug mode, but terminates in release mode. HOT 2
- Ignore specific instructions building the SVFG? HOT 3
- Question: how to find all GEP reads and writes to a specific variable? HOT 7
- Get "points-by" information in DDA query HOT 3
- Cannot buildSVFModule after pulling latest commit (from 9658ef4 to the latest) HOT 6
- Is there a good way to implement an LLVM pass based on SVF HOT 1
- Getting StmtVFGNode from FormalParmVFGNode nodes for value flow in function arguments HOT 3
- Assertion Failure in `SVF::CHGBuilder::analyzeVTables` HOT 3
- Divergent Results and Loading Concerns in buildSVFModule Methods HOT 5
- Set Option in a programmable way HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svf.