-
Notifications
You must be signed in to change notification settings - Fork 435
Write a source sink analyzer
unsw-corg edited this page Jul 20, 2015
·
16 revisions
Writing a source-sink analyzer become fairly easy on top of our interprocedure sparse value-flow graph (you may wish to refer to LeakCheck.cpp to see the detail code implementations).
- First, we need to build SVFG using andersen's pointer analysis
PointerAnalysis* ander = AndersenWaveDiff::createAndersenWaveDiff(module);
svfg = new SVFGOPT(ptaCallGraph);
svfgbuilder.build(svfg,ander);
- Choose a set of candidate sources and sinks
Simple code to iterate from a SVFGNode on SVFG
for(SVFGNode::const_iterator it = node->OutEdgeBegin(), eit = node->OutEdgeEnd(); it!=eit; ++it) {
}
- Perform all path reachable analysis using AllPathReachableSolve method (ProgSlice class) which computes value-flow guards via the following three methods iteratively util a fixed point is reached.
- ComputeInterCallVFGGuard
- ComputeInterRetVFGGuard
- ComputeIntraVFGGuard