svf-tools 1.0.1196 → 1.0.1197
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/svf/include/DDA/DDAClient.h +1 -1
- package/svf/include/DDA/DDAVFSolver.h +3 -3
- package/svf/include/Graphs/ConsG.h +2 -2
- package/svf/include/MemoryModel/PointerAnalysis.h +3 -3
- package/svf/include/MemoryModel/PointerAnalysisImpl.h +2 -2
- package/svf/include/SVFIR/SVFIR.h +63 -9
- package/svf/lib/AE/Core/AbstractState.cpp +1 -1
- package/svf/lib/AE/Svfexe/AEDetector.cpp +7 -7
- package/svf/lib/AE/Svfexe/AbsExtAPI.cpp +3 -3
- package/svf/lib/AE/Svfexe/AbstractInterpretation.cpp +5 -5
- package/svf/lib/DDA/ContextDDA.cpp +5 -5
- package/svf/lib/DDA/DDAClient.cpp +1 -1
- package/svf/lib/DDA/DDAPass.cpp +2 -2
- package/svf/lib/DDA/FlowDDA.cpp +1 -1
- package/svf/lib/Graphs/ConsG.cpp +5 -6
- package/svf/lib/Graphs/SVFG.cpp +6 -6
- package/svf/lib/Graphs/ThreadCallGraph.cpp +1 -1
- package/svf/lib/Graphs/VFG.cpp +19 -19
- package/svf/lib/MSSA/MemRegion.cpp +1 -1
- package/svf/lib/MTA/TCT.cpp +2 -2
- package/svf/lib/MemoryModel/PointerAnalysis.cpp +7 -7
- package/svf/lib/MemoryModel/PointerAnalysisImpl.cpp +19 -19
- package/svf/lib/SABER/SaberSVFGBuilder.cpp +3 -3
- package/svf/lib/SVFIR/SVFIR.cpp +8 -8
- package/svf/lib/Util/CDGBuilder.cpp +1 -1
- package/svf/lib/WPA/Andersen.cpp +9 -9
- package/svf/lib/WPA/AndersenStat.cpp +4 -4
- package/SVF-doxygen/doxygen.config +0 -2548
- package/SVF-doxygen/wiki/PAG.png +0 -0
- package/SVF-doxygen/wiki/andersen.png +0 -0
- package/SVF-doxygen/wiki/callgraph.png +0 -0
- package/SVF-doxygen/wiki/consG.png +0 -0
- package/SVF-doxygen/wiki/cpu2000-flto +0 -432
- package/SVF-doxygen/wiki/cpu2006-flto +0 -417
- package/SVF-doxygen/wiki/cpu2017-wllvm.cfg +0 -999
- package/SVF-doxygen/wiki/database.png +0 -0
- package/SVF-doxygen/wiki/framework.png +0 -0
- package/SVF-doxygen/wiki/help.png +0 -0
- package/SVF-doxygen/wiki/icfg.png +0 -0
- package/SVF-doxygen/wiki/mssa-cha.png +0 -0
- package/SVF-doxygen/wiki/pagedge.png +0 -0
- package/SVF-doxygen/wiki/pagnode.png +0 -0
- package/SVF-doxygen/wiki/pt.png +0 -0
- package/SVF-doxygen/wiki/setupcmake.png +0 -0
- package/SVF-doxygen/wiki/setupconfiguration.png +0 -0
- package/SVF-doxygen/wiki/setupdashboard.png +0 -0
- package/SVF-doxygen/wiki/setupdebug.png +0 -0
- package/SVF-doxygen/wiki/setupenv.png +0 -0
- package/SVF-doxygen/wiki/startup.png +0 -0
- package/SVF-doxygen/wiki/svf-stat.pdf +0 -0
- package/SVF-doxygen/wiki/svfg-framework.png +0 -0
- package/SVF-doxygen/wiki/svfg.png +0 -0
- package/SVF-doxygen/wiki/svfg_opt.png +0 -0
- package/SVF-doxygen/wiki/svfgedge-cha.png +0 -0
- package/SVF-doxygen/wiki/svfgnode-cha.png +0 -0
- package/SVF-doxygen/wiki/svfpic/README.md +0 -6
- package/SVF-doxygen/wiki/svfpic/ass-1debug1.png +0 -0
- package/SVF-doxygen/wiki/svfpic/ass-1debug2.png +0 -0
- package/SVF-doxygen/wiki/svfpic/build.jpg +0 -0
- package/SVF-doxygen/wiki/svfpic/cmd.png +0 -0
- package/SVF-doxygen/wiki/svfpic/connect1.jpg +0 -0
- package/SVF-doxygen/wiki/svfpic/connect2.png +0 -0
- package/SVF-doxygen/wiki/svfpic/connect3.png +0 -0
- package/SVF-doxygen/wiki/svfpic/connect4.jpg +0 -0
- package/SVF-doxygen/wiki/svfpic/connect5.jpg +0 -0
- package/SVF-doxygen/wiki/svfpic/connect6.png +0 -0
- package/SVF-doxygen/wiki/svfpic/connect7.jpg +0 -0
- package/SVF-doxygen/wiki/svfpic/continue.png +0 -0
- package/SVF-doxygen/wiki/svfpic/debug-new.png +0 -0
- package/SVF-doxygen/wiki/svfpic/debug-new2.png +0 -0
- package/SVF-doxygen/wiki/svfpic/debug1.jpeg +0 -0
- package/SVF-doxygen/wiki/svfpic/debug2.jpeg +0 -0
- package/SVF-doxygen/wiki/svfpic/debug3.png +0 -0
- package/SVF-doxygen/wiki/svfpic/debug4.png +0 -0
- package/SVF-doxygen/wiki/svfpic/debug5.jpeg +0 -0
- package/SVF-doxygen/wiki/svfpic/debug6.jpeg +0 -0
- package/SVF-doxygen/wiki/svfpic/docker_sys_requirement.png +0 -0
- package/SVF-doxygen/wiki/svfpic/docker_sys_requirements.png +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerbuild.png +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerbuild2.jpg +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerbuild3.jpg +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerbuild4.png +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerbuild5.jpg +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerbuildimage.png +0 -0
- package/SVF-doxygen/wiki/svfpic/dockercmd.png +0 -0
- package/SVF-doxygen/wiki/svfpic/dockercmd2.png +0 -0
- package/SVF-doxygen/wiki/svfpic/dockercontainer.png +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerdb1.jpg +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerdb10.jpeg +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerdb2.jpg +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerdb3.jpg +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerdb4.jpg +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerdb5.png +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerdb6.jpeg +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerdb7.png +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerdb8.png +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerdb9.jpeg +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerfinshbuilt.png +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerimage.png +0 -0
- package/SVF-doxygen/wiki/svfpic/dockernameImage.png +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerpull.png +0 -0
- package/SVF-doxygen/wiki/svfpic/dockerpull2.png +0 -0
- package/SVF-doxygen/wiki/svfpic/download.jpg +0 -0
- package/SVF-doxygen/wiki/svfpic/extension1.jpeg +0 -0
- package/SVF-doxygen/wiki/svfpic/extension2.jpeg +0 -0
- package/SVF-doxygen/wiki/svfpic/graphviz.png +0 -0
- package/SVF-doxygen/wiki/svfpic/hellodb.png +0 -0
- package/SVF-doxygen/wiki/svfpic/hellodb2.png +0 -0
- package/SVF-doxygen/wiki/svfpic/hviz_0.png +0 -0
- package/SVF-doxygen/wiki/svfpic/hviz_1.png +0 -0
- package/SVF-doxygen/wiki/svfpic/hviz_2.png +0 -0
- package/SVF-doxygen/wiki/svfpic/installC:C++Ext.png +0 -0
- package/SVF-doxygen/wiki/svfpic/installCMakeExt.png +0 -0
- package/SVF-doxygen/wiki/svfpic/installRCext.png +0 -0
- package/SVF-doxygen/wiki/svfpic/installdockerext.png +0 -0
- package/SVF-doxygen/wiki/svfpic/launch1.png +0 -0
- package/SVF-doxygen/wiki/svfpic/openfile.png +0 -0
- package/SVF-doxygen/wiki/svfpic/pathfolder.png +0 -0
- package/SVF-doxygen/wiki/svfpic/restart.png +0 -0
- package/SVF-doxygen/wiki/svfpic/rundocker.png +0 -0
- package/SVF-doxygen/wiki/svfpic/runinCLI.png +0 -0
- package/SVF-doxygen/wiki/svfpic/screen.png +0 -0
- package/SVF-doxygen/wiki/svfpic/settings1.jpg +0 -0
- package/SVF-doxygen/wiki/svfpic/settings2.jpg +0 -0
- package/SVF-doxygen/wiki/svfpic/settings3.jpg +0 -0
- package/SVF-doxygen/wiki/svfpic/shortlists.png +0 -0
- package/SVF-doxygen/wiki/svfpic/start.png +0 -0
- package/SVF-doxygen/wiki/svfpic/start1.png +0 -0
- package/SVF-doxygen/wiki/svfpic/update0.png +0 -0
- package/SVF-doxygen/wiki/svfpic/verify_docker.png +0 -0
- package/SVF-doxygen/wiki/svfpic/vs_entry_window.png +0 -0
- package/SVF-doxygen/wiki/svfpic/wsl.png +0 -0
- package/SVF-doxygen/wiki/svfpic/wsl_1.png +0 -0
- package/SVF-doxygen/wiki/svfpic/wsl_2.png +0 -0
- package/SVF-doxygen/wiki/svfpic/wsl_3.png +0 -0
- package/SVF-doxygen/wiki/tools.png +0 -0
- package/SVF-doxygen/wiki/users.png +0 -0
- package/SVF-doxygen/wiki/vm1.png +0 -0
- package/SVF-doxygen/wiki/vm2.png +0 -0
- package/SVF-doxygen/wiki/vm3.png +0 -0
- package/SVF-doxygen/wiki/vm4.png +0 -0
- package/SVF-doxygen/wiki/vm5.png +0 -0
- package/SVF-doxygen/wiki/vscode_build_tasks.png +0 -0
- package/SVF-doxygen/wiki/vscode_cpp_extension.png +0 -0
- package/SVF-doxygen/wiki/vscode_debug_list.png +0 -0
- package/SVF-doxygen/wiki/vscode_dir_structure.png +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1197",
|
|
4
4
|
"description": "* <b>[TypeClone](https://github.com/SVF-tools/SVF/wiki/TypeClone) published in our [ECOOP paper](https://yuleisui.github.io/publications/ecoop20.pdf) is now available in SVF </b> * <b>SVF now uses a single script for its build. Just type [`source ./build.sh`](https://github.com/SVF-tools/SVF/blob/master/build.sh) in your terminal, that's it!</b> * <b>SVF now supports LLVM-10.0.0! </b> * <b>We thank [bsauce](https://github.com/bsauce) for writing a user manual of SVF ([link1](https://www.jianshu.com/p/068a08ec749c) and [link2](https://www.jianshu.com/p/777c30d4240e)) in Chinese </b> * <b>SVF now supports LLVM-9.0.0 (Thank [Byoungyoung Lee](https://github.com/SVF-tools/SVF/issues/142) for his help!). </b> * <b>SVF now supports a set of [field-sensitive pointer analyses](https://yuleisui.github.io/publications/sas2019a.pdf). </b> * <b>[Use SVF as an external lib](https://github.com/SVF-tools/SVF/wiki/Using-SVF-as-a-lib-in-your-own-tool) for your own project (Contributed by [Hongxu Chen](https://github.com/HongxuChen)). </b> * <b>SVF now supports LLVM-7.0.0. </b> * <b>SVF now supports Docker. [Try SVF in Docker](https://github.com/SVF-tools/SVF/wiki/Try-SVF-in-Docker)! </b> * <b>SVF now supports [LLVM-6.0.0](https://github.com/svf-tools/SVF/pull/38) (Contributed by [Jack Anthony](https://github.com/jackanth)). </b> * <b>SVF now supports [LLVM-4.0.0](https://github.com/svf-tools/SVF/pull/23) (Contributed by Jared Carlson. Thank [Jared](https://github.com/jcarlson23) and [Will](https://github.com/dtzWill) for their in-depth [discussions](https://github.com/svf-tools/SVF/pull/18) about updating SVF!) </b> * <b>SVF now supports analysis for C++ programs.</b> <br />",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -475,7 +475,7 @@ protected:
|
|
|
475
475
|
assert(baseObj && "base object is null??");
|
|
476
476
|
if(SVFUtil::isa<StackObjVar>(baseObj))
|
|
477
477
|
{
|
|
478
|
-
if(const FunObjVar* svffun = _pag->
|
|
478
|
+
if(const FunObjVar* svffun = _pag->getSVFVar(id)->getFunction())
|
|
479
479
|
{
|
|
480
480
|
return _callGraphSCC->isInCycle(_callGraph->getCallGraphNode(svffun)->getId());
|
|
481
481
|
}
|
|
@@ -497,7 +497,7 @@ protected:
|
|
|
497
497
|
{
|
|
498
498
|
NodeID funPtr = _pag->getFunPtr(cbn);
|
|
499
499
|
DPIm funPtrDpm(dpm);
|
|
500
|
-
funPtrDpm.setLocVar(getSVFG()->getDefSVFGNode(_pag->
|
|
500
|
+
funPtrDpm.setLocVar(getSVFG()->getDefSVFGNode(_pag->getSVFVar(funPtr)),funPtr);
|
|
501
501
|
findPT(funPtrDpm);
|
|
502
502
|
}
|
|
503
503
|
}
|
|
@@ -510,7 +510,7 @@ protected:
|
|
|
510
510
|
{
|
|
511
511
|
NodeID funPtr = _pag->getFunPtr(*it);
|
|
512
512
|
DPIm funPtrDpm(dpm);
|
|
513
|
-
funPtrDpm.setLocVar(getSVFG()->getDefSVFGNode(_pag->
|
|
513
|
+
funPtrDpm.setLocVar(getSVFG()->getDefSVFGNode(_pag->getSVFVar(funPtr)),funPtr);
|
|
514
514
|
findPT(funPtrDpm);
|
|
515
515
|
}
|
|
516
516
|
}
|
|
@@ -312,9 +312,9 @@ public:
|
|
|
312
312
|
{
|
|
313
313
|
return pag->getAllFieldsObjVars(id);
|
|
314
314
|
}
|
|
315
|
-
inline NodeID
|
|
315
|
+
inline NodeID getBaseObjVarID(NodeID id)
|
|
316
316
|
{
|
|
317
|
-
return pag->
|
|
317
|
+
return pag->getBaseObjVarID(id);
|
|
318
318
|
}
|
|
319
319
|
inline bool isSingleFieldObj(NodeID id) const
|
|
320
320
|
{
|
|
@@ -312,11 +312,11 @@ public:
|
|
|
312
312
|
///@{
|
|
313
313
|
inline bool isFIObjNode(NodeID id) const
|
|
314
314
|
{
|
|
315
|
-
return (SVFUtil::isa<BaseObjVar>(pag->
|
|
315
|
+
return (SVFUtil::isa<BaseObjVar>(pag->getSVFVar(id)));
|
|
316
316
|
}
|
|
317
|
-
inline NodeID
|
|
317
|
+
inline NodeID getBaseObjVarID(NodeID id)
|
|
318
318
|
{
|
|
319
|
-
return pag->
|
|
319
|
+
return pag->getBaseObjVarID(id);
|
|
320
320
|
}
|
|
321
321
|
inline NodeID getFIObjVar(NodeID id)
|
|
322
322
|
{
|
|
@@ -348,7 +348,7 @@ public:
|
|
|
348
348
|
expandedCpts = cpts;;
|
|
349
349
|
for(typename CPtSet::const_iterator cit = cpts.begin(), ecit=cpts.end(); cit!=ecit; ++cit)
|
|
350
350
|
{
|
|
351
|
-
if(pag->
|
|
351
|
+
if(pag->getBaseObjVarID(cit->get_id())==cit->get_id())
|
|
352
352
|
{
|
|
353
353
|
NodeBS& fields = pag->getAllFieldsObjVars(cit->get_id());
|
|
354
354
|
for(NodeBS::iterator it = fields.begin(), eit = fields.end(); it!=eit; ++it)
|
|
@@ -564,7 +564,7 @@ public:
|
|
|
564
564
|
{
|
|
565
565
|
for (OrderedNodeSet::iterator nIter = this->getAllValidPtrs().begin(); nIter != this->getAllValidPtrs().end(); ++nIter)
|
|
566
566
|
{
|
|
567
|
-
const
|
|
567
|
+
const SVFVar* node = this->getPAG()->getSVFVar(*nIter);
|
|
568
568
|
if (this->getPAG()->isValidTopLevelPtr(node))
|
|
569
569
|
{
|
|
570
570
|
if (SVFUtil::isa<DummyObjVar>(node))
|
|
@@ -64,9 +64,9 @@ public:
|
|
|
64
64
|
typedef Map<const FunObjVar*,SVFStmtSet> FunToPAGEdgeSetMap;
|
|
65
65
|
typedef Map<const ICFGNode*,SVFStmtList> ICFGNode2SVFStmtsMap;
|
|
66
66
|
typedef Map<NodeID, NodeID> NodeToNodeMap;
|
|
67
|
-
typedef std::pair<NodeID, APOffset>
|
|
67
|
+
typedef std::pair<NodeID, APOffset> GepOffset;
|
|
68
68
|
typedef std::pair<NodeID, AccessPath> NodeAccessPath;
|
|
69
|
-
typedef Map<
|
|
69
|
+
typedef Map<GepOffset,NodeID> OffsetToGepVarMap;
|
|
70
70
|
typedef Map<NodeAccessPath,NodeID> NodeAccessPathMap;
|
|
71
71
|
typedef Map<NodeID, NodeAccessPathMap> GepValueVarMap;
|
|
72
72
|
typedef std::pair<const SVFType*, std::vector<AccessPath>> SVFTypeLocSetsPair;
|
|
@@ -80,7 +80,7 @@ private:
|
|
|
80
80
|
ICFGNode2SVFStmtsMap icfgNode2PTASVFStmtsMap; ///< Map an ICFGNode to its PointerAnalysis related SVFStmts
|
|
81
81
|
GepValueVarMap GepValObjMap; ///< Map a pair<base,off> to a gep value node id
|
|
82
82
|
TypeLocSetsMap typeLocSetsMap; ///< Map an arg to its base SVFType* and all its field location sets
|
|
83
|
-
|
|
83
|
+
OffsetToGepVarMap GepObjVarMap; ///< Map a pair<base,off> to a gep obj node id
|
|
84
84
|
MemObjToFieldsMap memToFieldsMap; ///< Map a mem object id to all its fields
|
|
85
85
|
SVFStmtSet globSVFStmtSet; ///< Global PAGEdges without control flow information
|
|
86
86
|
PHINodeMap phiNodeMap; ///< A set of phi copy edges
|
|
@@ -126,13 +126,67 @@ public:
|
|
|
126
126
|
pag = nullptr;
|
|
127
127
|
}
|
|
128
128
|
//@}
|
|
129
|
+
/// ObjVar/GepObjVar/BaseObjVar
|
|
130
|
+
//@{
|
|
131
|
+
inline const SVFVar* getSVFVar(NodeID id) const
|
|
132
|
+
{
|
|
133
|
+
return getGNode(id);
|
|
134
|
+
}
|
|
135
|
+
inline const ObjVar* getObjVar(NodeID id) const
|
|
136
|
+
{
|
|
137
|
+
if(const SVFVar* var = getSVFVar(id))
|
|
138
|
+
return SVFUtil::dyn_cast<ObjVar>(var);
|
|
139
|
+
else
|
|
140
|
+
{
|
|
141
|
+
assert(false && "the Node is not an ObjVar");
|
|
142
|
+
return nullptr;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
inline const BaseObjVar* getBaseObjVar(NodeID id) const
|
|
146
|
+
{
|
|
147
|
+
if(const SVFVar* var = getSVFVar(id))
|
|
148
|
+
return SVFUtil::dyn_cast<BaseObjVar>(var);
|
|
149
|
+
else
|
|
150
|
+
{
|
|
151
|
+
assert(false && "the Node is not a BaseObjVar");
|
|
152
|
+
return nullptr;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
inline const GepObjVar* getGepObjVar(NodeID id) const
|
|
156
|
+
{
|
|
157
|
+
if(const SVFVar* var = getSVFVar(id))
|
|
158
|
+
return SVFUtil::dyn_cast<GepObjVar>(var);
|
|
159
|
+
else
|
|
160
|
+
{
|
|
161
|
+
assert(false && "the Node is not a GepObjVar");
|
|
162
|
+
return nullptr;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
inline bool isObjVar(NodeID id) const
|
|
166
|
+
{
|
|
167
|
+
return SVFUtil::isa<ObjVar>(getSVFVar(id));
|
|
168
|
+
}
|
|
169
|
+
inline bool isBaseObjVar(NodeID id) const
|
|
170
|
+
{
|
|
171
|
+
return SVFUtil::isa<BaseObjVar>(getSVFVar(id));
|
|
172
|
+
}
|
|
173
|
+
inline bool isGepObjVar(NodeID id) const
|
|
174
|
+
{
|
|
175
|
+
return SVFUtil::isa<GepObjVar>(getSVFVar(id));
|
|
176
|
+
}
|
|
177
|
+
/// Return the entire SVFID to SVFVar map
|
|
178
|
+
inline const IDToNodeMapTy& getSVFVarMap() const
|
|
179
|
+
{
|
|
180
|
+
return IDToNodeMap;
|
|
181
|
+
}
|
|
182
|
+
//@}
|
|
129
183
|
/// Return memToFieldsMap
|
|
130
184
|
inline MemObjToFieldsMap& getMemToFieldsMap()
|
|
131
185
|
{
|
|
132
186
|
return memToFieldsMap;
|
|
133
187
|
}
|
|
134
188
|
/// Return GepObjVarMap
|
|
135
|
-
inline
|
|
189
|
+
inline OffsetToGepVarMap& getGepObjNodeMap()
|
|
136
190
|
{
|
|
137
191
|
return GepObjVarMap;
|
|
138
192
|
}
|
|
@@ -423,17 +477,17 @@ public:
|
|
|
423
477
|
//@{
|
|
424
478
|
inline const BaseObjVar* getBaseObject(NodeID id) const
|
|
425
479
|
{
|
|
426
|
-
const SVFVar* node =
|
|
480
|
+
const SVFVar* node = getSVFVar(id);
|
|
427
481
|
if(const GepObjVar* gepObjVar = SVFUtil::dyn_cast<GepObjVar>(node))
|
|
428
482
|
return SVFUtil::dyn_cast<BaseObjVar>(
|
|
429
|
-
|
|
483
|
+
getSVFVar(gepObjVar->getBaseNode()));
|
|
430
484
|
else
|
|
431
485
|
return SVFUtil::dyn_cast<BaseObjVar>(node);
|
|
432
486
|
}
|
|
433
487
|
|
|
434
488
|
inline const ValVar* getBaseValVar(NodeID id) const
|
|
435
489
|
{
|
|
436
|
-
const SVFVar* node =
|
|
490
|
+
const SVFVar* node = getSVFVar(id);
|
|
437
491
|
if(const GepValVar* gepVar = SVFUtil::dyn_cast<GepValVar>(node))
|
|
438
492
|
return gepVar->getBaseNode();
|
|
439
493
|
else
|
|
@@ -453,7 +507,7 @@ public:
|
|
|
453
507
|
}
|
|
454
508
|
inline NodeID getFIObjVar(NodeID id) const
|
|
455
509
|
{
|
|
456
|
-
return
|
|
510
|
+
return getBaseObjVarID(id);
|
|
457
511
|
}
|
|
458
512
|
//@}
|
|
459
513
|
|
|
@@ -477,7 +531,7 @@ public:
|
|
|
477
531
|
/// Base and Offset methods for Value and Object node
|
|
478
532
|
//@{
|
|
479
533
|
/// Get a base pointer node given a field pointer
|
|
480
|
-
inline NodeID
|
|
534
|
+
inline NodeID getBaseObjVarID(NodeID id) const
|
|
481
535
|
{
|
|
482
536
|
return getBaseObject(id)->getId();
|
|
483
537
|
}
|
|
@@ -172,7 +172,7 @@ AddressValue AbstractState::getGepObjAddrs(u32_t pointer, IntervalValue offset)
|
|
|
172
172
|
for (const auto& addr : addrs.getAddrs())
|
|
173
173
|
{
|
|
174
174
|
s64_t baseObj = getIDFromAddr(addr);
|
|
175
|
-
assert(SVFUtil::isa<ObjVar>(PAG::getPAG()->
|
|
175
|
+
assert(SVFUtil::isa<ObjVar>(PAG::getPAG()->getSVFVar(baseObj)) && "Fail to get the base object address!");
|
|
176
176
|
NodeID gepObj = PAG::getPAG()->getGepObjVar(baseObj, i);
|
|
177
177
|
(*this)[gepObj] = AddressValue(AbstractState::getVirtualMemAddress(gepObj));
|
|
178
178
|
gepAddrs.insert(AbstractState::getVirtualMemAddress(gepObj));
|
|
@@ -313,7 +313,7 @@ void BufOverflowDetector::detectExtAPI(AbstractState& as,
|
|
|
313
313
|
IntervalValue BufOverflowDetector::getAccessOffset(SVF::AbstractState& as, SVF::NodeID objId, const SVF::GepStmt* gep)
|
|
314
314
|
{
|
|
315
315
|
SVFIR* svfir = PAG::getPAG();
|
|
316
|
-
auto obj = svfir->
|
|
316
|
+
auto obj = svfir->getSVFVar(objId);
|
|
317
317
|
|
|
318
318
|
if (SVFUtil::isa<BaseObjVar>(obj))
|
|
319
319
|
{
|
|
@@ -351,7 +351,7 @@ void BufOverflowDetector::updateGepObjOffsetFromBase(AbstractState& as, SVF::Add
|
|
|
351
351
|
for (const auto& objAddr : objAddrs)
|
|
352
352
|
{
|
|
353
353
|
NodeID objId = as.getIDFromAddr(objAddr);
|
|
354
|
-
auto obj = svfir->
|
|
354
|
+
auto obj = svfir->getSVFVar(objId);
|
|
355
355
|
|
|
356
356
|
if (SVFUtil::isa<BaseObjVar>(obj))
|
|
357
357
|
{
|
|
@@ -361,7 +361,7 @@ void BufOverflowDetector::updateGepObjOffsetFromBase(AbstractState& as, SVF::Add
|
|
|
361
361
|
for (const auto& gepAddr : gepAddrs)
|
|
362
362
|
{
|
|
363
363
|
NodeID gepObj = as.getIDFromAddr(gepAddr);
|
|
364
|
-
if (const GepObjVar* gepObjVar = SVFUtil::dyn_cast<GepObjVar>(svfir->
|
|
364
|
+
if (const GepObjVar* gepObjVar = SVFUtil::dyn_cast<GepObjVar>(svfir->getSVFVar(gepObj)))
|
|
365
365
|
{
|
|
366
366
|
addToGepObjOffsetFromBase(gepObjVar, offset);
|
|
367
367
|
}
|
|
@@ -380,7 +380,7 @@ void BufOverflowDetector::updateGepObjOffsetFromBase(AbstractState& as, SVF::Add
|
|
|
380
380
|
for (const auto& gepAddr : gepAddrs)
|
|
381
381
|
{
|
|
382
382
|
NodeID gepObj = as.getIDFromAddr(gepAddr);
|
|
383
|
-
if (const GepObjVar* gepObjVar = SVFUtil::dyn_cast<GepObjVar>(svfir->
|
|
383
|
+
if (const GepObjVar* gepObjVar = SVFUtil::dyn_cast<GepObjVar>(svfir->getSVFVar(gepObj)))
|
|
384
384
|
{
|
|
385
385
|
if (hasGepObjOffsetFromBase(objVar))
|
|
386
386
|
{
|
|
@@ -520,11 +520,11 @@ bool BufOverflowDetector::canSafelyAccessMemory(AbstractState& as, const SVF::SV
|
|
|
520
520
|
|
|
521
521
|
IntervalValue offset(0);
|
|
522
522
|
// if the object is a GepObjVar, get the offset from the base object
|
|
523
|
-
if (SVFUtil::isa<GepObjVar>(svfir->
|
|
523
|
+
if (SVFUtil::isa<GepObjVar>(svfir->getSVFVar(objId)))
|
|
524
524
|
{
|
|
525
|
-
offset = getGepObjOffsetFromBase(SVFUtil::cast<GepObjVar>(svfir->
|
|
525
|
+
offset = getGepObjOffsetFromBase(SVFUtil::cast<GepObjVar>(svfir->getSVFVar(objId))) + len;
|
|
526
526
|
}
|
|
527
|
-
else if (SVFUtil::isa<BaseObjVar>(svfir->
|
|
527
|
+
else if (SVFUtil::isa<BaseObjVar>(svfir->getSVFVar(objId)))
|
|
528
528
|
{
|
|
529
529
|
// if the object is a BaseObjVar, get the offset directly
|
|
530
530
|
offset = len;
|
|
@@ -165,7 +165,7 @@ void AbsExtAPI::initExtFunMap()
|
|
|
165
165
|
for (auto vaddr: Addrs.getAddrs())
|
|
166
166
|
{
|
|
167
167
|
u32_t objId = as.getIDFromAddr(vaddr);
|
|
168
|
-
AbstractValue range = getRangeLimitFromType(svfir->
|
|
168
|
+
AbstractValue range = getRangeLimitFromType(svfir->getSVFVar(objId)->getType());
|
|
169
169
|
as.store(vaddr, range);
|
|
170
170
|
}
|
|
171
171
|
}
|
|
@@ -185,7 +185,7 @@ void AbsExtAPI::initExtFunMap()
|
|
|
185
185
|
for (auto vaddr: Addrs.getAddrs())
|
|
186
186
|
{
|
|
187
187
|
u32_t objId = as.getIDFromAddr(vaddr);
|
|
188
|
-
AbstractValue range = getRangeLimitFromType(svfir->
|
|
188
|
+
AbstractValue range = getRangeLimitFromType(svfir->getSVFVar(objId)->getType());
|
|
189
189
|
as.store(vaddr, range);
|
|
190
190
|
}
|
|
191
191
|
}
|
|
@@ -423,7 +423,7 @@ void AbsExtAPI::handleExtAPI(const CallICFGNode *call)
|
|
|
423
423
|
else if (extType == MEMCPY)
|
|
424
424
|
{
|
|
425
425
|
IntervalValue len = as[call->getArgument(2)->getId()].getInterval();
|
|
426
|
-
svfir->
|
|
426
|
+
(void)svfir->getSVFVar(call->getArgument(0)->getId());
|
|
427
427
|
handleMemcpy(as, call->getArgument(0), call->getArgument(1), len, 0);
|
|
428
428
|
}
|
|
429
429
|
else if (extType == MEMSET)
|
|
@@ -360,7 +360,7 @@ bool AbstractInterpretation::isCmpBranchFeasible(const CmpStmt* cmpStmt, s64_t s
|
|
|
360
360
|
const LoadStmt *load_op0 = nullptr;
|
|
361
361
|
const LoadStmt *load_op1 = nullptr;
|
|
362
362
|
// get '%1 = load i32 s', and load inst may not exist
|
|
363
|
-
SVFVar* loadVar0 = svfir->
|
|
363
|
+
const SVFVar* loadVar0 = svfir->getSVFVar(op0);
|
|
364
364
|
if (!loadVar0->getInEdges().empty())
|
|
365
365
|
{
|
|
366
366
|
SVFStmt *loadVar0InStmt = *loadVar0->getInEdges().begin();
|
|
@@ -370,7 +370,7 @@ bool AbstractInterpretation::isCmpBranchFeasible(const CmpStmt* cmpStmt, s64_t s
|
|
|
370
370
|
}
|
|
371
371
|
else if (const CopyStmt *copyStmt = SVFUtil::dyn_cast<CopyStmt>(loadVar0InStmt))
|
|
372
372
|
{
|
|
373
|
-
loadVar0 = svfir->
|
|
373
|
+
loadVar0 = svfir->getSVFVar(copyStmt->getRHSVarID());
|
|
374
374
|
if (!loadVar0->getInEdges().empty())
|
|
375
375
|
{
|
|
376
376
|
SVFStmt *loadVar0InStmt2 = *loadVar0->getInEdges().begin();
|
|
@@ -382,7 +382,7 @@ bool AbstractInterpretation::isCmpBranchFeasible(const CmpStmt* cmpStmt, s64_t s
|
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
|
|
385
|
-
SVFVar* loadVar1 = svfir->
|
|
385
|
+
const SVFVar* loadVar1 = svfir->getSVFVar(op1);
|
|
386
386
|
if (!loadVar1->getInEdges().empty())
|
|
387
387
|
{
|
|
388
388
|
SVFStmt *loadVar1InStmt = *loadVar1->getInEdges().begin();
|
|
@@ -392,7 +392,7 @@ bool AbstractInterpretation::isCmpBranchFeasible(const CmpStmt* cmpStmt, s64_t s
|
|
|
392
392
|
}
|
|
393
393
|
else if (const CopyStmt *copyStmt = SVFUtil::dyn_cast<CopyStmt>(loadVar1InStmt))
|
|
394
394
|
{
|
|
395
|
-
loadVar1 = svfir->
|
|
395
|
+
loadVar1 = svfir->getSVFVar(copyStmt->getRHSVarID());
|
|
396
396
|
if (!loadVar1->getInEdges().empty())
|
|
397
397
|
{
|
|
398
398
|
SVFStmt *loadVar1InStmt2 = *loadVar1->getInEdges().begin();
|
|
@@ -954,7 +954,7 @@ const FunObjVar* AbstractInterpretation::getCallee(const CallICFGNode* callNode)
|
|
|
954
954
|
return nullptr;
|
|
955
955
|
|
|
956
956
|
NodeID addr = *Addrs.getAddrs().begin();
|
|
957
|
-
SVFVar* func_var = svfir->
|
|
957
|
+
const SVFVar* func_var = svfir->getSVFVar(as.getIDFromAddr(addr));
|
|
958
958
|
return SVFUtil::dyn_cast<FunObjVar>(func_var);
|
|
959
959
|
}
|
|
960
960
|
|
|
@@ -79,7 +79,7 @@ const CxtPtSet& ContextDDA::computeDDAPts(const CxtVar& var)
|
|
|
79
79
|
LocDPItem::setMaxBudget(Options::CxtBudget());
|
|
80
80
|
|
|
81
81
|
NodeID id = var.get_id();
|
|
82
|
-
|
|
82
|
+
const SVFVar* node = getPAG()->getSVFVar(id);
|
|
83
83
|
CxtLocDPItem dpm = getDPIm(var, getDefSVFGNode(node));
|
|
84
84
|
|
|
85
85
|
// start DDA analysis
|
|
@@ -191,7 +191,7 @@ bool ContextDDA::testIndCallReachability(CxtLocDPItem& dpm, const FunObjVar* cal
|
|
|
191
191
|
if(getPAG()->isIndirectCallSites(cs))
|
|
192
192
|
{
|
|
193
193
|
NodeID id = getPAG()->getFunPtr(cs);
|
|
194
|
-
|
|
194
|
+
const SVFVar* node = getPAG()->getSVFVar(id);
|
|
195
195
|
CxtVar funptrVar(dpm.getCondVar().get_cond(), id);
|
|
196
196
|
CxtLocDPItem funptrDpm = getDPIm(funptrVar,getDefSVFGNode(node));
|
|
197
197
|
PointsTo pts = getBVPointsTo(findPT(funptrDpm));
|
|
@@ -342,11 +342,11 @@ bool ContextDDA::isHeapCondMemObj(const CxtVar& var, const StoreSVFGNode*)
|
|
|
342
342
|
{
|
|
343
343
|
if (!isa<DummyObjVar>(baseVar))
|
|
344
344
|
{
|
|
345
|
-
|
|
346
|
-
GepObjVar* gepobj = SVFUtil::dyn_cast<GepObjVar>(pnode);
|
|
345
|
+
const SVFVar* pnode = _pag->getSVFVar(getPtrNodeID(var));
|
|
346
|
+
const GepObjVar* gepobj = SVFUtil::dyn_cast<GepObjVar>(pnode);
|
|
347
347
|
if (gepobj != nullptr)
|
|
348
348
|
{
|
|
349
|
-
assert(SVFUtil::isa<DummyObjVar>(_pag->
|
|
349
|
+
assert(SVFUtil::isa<DummyObjVar>(_pag->getSVFVar(gepobj->getBaseNode()))
|
|
350
350
|
&& "empty refVal in a gep object whose base is a non-dummy object");
|
|
351
351
|
}
|
|
352
352
|
else
|
|
@@ -58,7 +58,7 @@ void DDAClient::answerQueries(PointerAnalysis* pta)
|
|
|
58
58
|
for (OrderedNodeSet::iterator nIter = candidateQueries.begin();
|
|
59
59
|
nIter != candidateQueries.end(); ++nIter,++count)
|
|
60
60
|
{
|
|
61
|
-
|
|
61
|
+
const SVFVar* node = pta->getPAG()->getSVFVar(*nIter);
|
|
62
62
|
if(pta->getPAG()->isValidTopLevelPtr(node))
|
|
63
63
|
{
|
|
64
64
|
DBOUT(DGENERAL,outs() << "\n@@Computing PointsTo for :" << node->getId() <<
|
package/svf/lib/DDA/DDAPass.cpp
CHANGED
|
@@ -282,10 +282,10 @@ AliasResult DDAPass::alias(NodeID node1, NodeID node2)
|
|
|
282
282
|
{
|
|
283
283
|
SVFIR* pag = _pta->getPAG();
|
|
284
284
|
|
|
285
|
-
if(pag->isValidTopLevelPtr(pag->
|
|
285
|
+
if(pag->isValidTopLevelPtr(pag->getSVFVar(node1)))
|
|
286
286
|
_pta->computeDDAPts(node1);
|
|
287
287
|
|
|
288
|
-
if(pag->isValidTopLevelPtr(pag->
|
|
288
|
+
if(pag->isValidTopLevelPtr(pag->getSVFVar(node2)))
|
|
289
289
|
_pta->computeDDAPts(node2);
|
|
290
290
|
|
|
291
291
|
return _pta->alias(node1,node2);
|
package/svf/lib/DDA/FlowDDA.cpp
CHANGED
|
@@ -45,7 +45,7 @@ void FlowDDA::computeDDAPts(NodeID id)
|
|
|
45
45
|
resetQuery();
|
|
46
46
|
LocDPItem::setMaxBudget(Options::FlowBudget());
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
const SVFVar* node = getPAG()->getSVFVar(id);
|
|
49
49
|
LocDPItem dpm = getDPIm(node->getId(),getDefSVFGNode(node));
|
|
50
50
|
|
|
51
51
|
/// start DDA analysis
|
package/svf/lib/Graphs/ConsG.cpp
CHANGED
|
@@ -163,7 +163,7 @@ void ConstraintGraph::clearSolitaries()
|
|
|
163
163
|
{
|
|
164
164
|
if (it->second->hasIncomingEdge() || it->second->hasOutgoingEdge())
|
|
165
165
|
continue;
|
|
166
|
-
if (pag->
|
|
166
|
+
if (pag->getSVFVar(it->first)->isPointer())
|
|
167
167
|
continue;
|
|
168
168
|
if (retFromIndCalls.find(it->first)!=retFromIndCalls.end())
|
|
169
169
|
continue;
|
|
@@ -188,8 +188,7 @@ AddrCGEdge::AddrCGEdge(ConstraintNode* s, ConstraintNode* d, EdgeID id)
|
|
|
188
188
|
: ConstraintEdge(s,d,Addr,id)
|
|
189
189
|
{
|
|
190
190
|
// Retarget addr edges may lead s to be a dummy node
|
|
191
|
-
|
|
192
|
-
(void)node; // Suppress warning of unused variable under release build
|
|
191
|
+
const SVFVar* node = SVFIR::getPAG()->getSVFVar(s->getId());
|
|
193
192
|
if (!SVFIR::pagReadFromTXT())
|
|
194
193
|
{
|
|
195
194
|
assert(!SVFUtil::isa<DummyValVar>(node) && "a dummy node??");
|
|
@@ -730,7 +729,7 @@ ConstraintNode::const_iterator ConstraintNode::directInEdgeEnd() const
|
|
|
730
729
|
|
|
731
730
|
const std::string ConstraintNode::toString() const
|
|
732
731
|
{
|
|
733
|
-
return SVFIR::getPAG()->
|
|
732
|
+
return SVFIR::getPAG()->getSVFVar(getId())->toString();
|
|
734
733
|
}
|
|
735
734
|
|
|
736
735
|
/*!
|
|
@@ -764,7 +763,7 @@ struct DOTGraphTraits<ConstraintGraph*> : public DOTGraphTraits<SVFIR*>
|
|
|
764
763
|
/// Either you can choose to display the name of the value or the whole instruction
|
|
765
764
|
static std::string getNodeLabel(NodeType *n, ConstraintGraph*)
|
|
766
765
|
{
|
|
767
|
-
|
|
766
|
+
const SVFVar* node = SVFIR::getPAG()->getSVFVar(n->getId());
|
|
768
767
|
bool briefDisplay = Options::BriefConsCGDotGraph();
|
|
769
768
|
bool nameDisplay = true;
|
|
770
769
|
std::string str;
|
|
@@ -797,7 +796,7 @@ struct DOTGraphTraits<ConstraintGraph*> : public DOTGraphTraits<SVFIR*>
|
|
|
797
796
|
|
|
798
797
|
static std::string getNodeAttributes(NodeType *n, ConstraintGraph*)
|
|
799
798
|
{
|
|
800
|
-
|
|
799
|
+
const SVFVar* node = SVFIR::getPAG()->getSVFVar(n->getId());
|
|
801
800
|
if (SVFUtil::isa<ValVar>(node))
|
|
802
801
|
{
|
|
803
802
|
if(SVFUtil::isa<GepValVar>(node))
|
package/svf/lib/Graphs/SVFG.cpp
CHANGED
|
@@ -595,8 +595,8 @@ void SVFG::getInterVFEdgesForIndirectCallSite(const CallICFGNode* callICFGNode,
|
|
|
595
595
|
SVFIR::SVFVarList::const_iterator funArgIt = funArgList.begin(), funArgEit = funArgList.end();
|
|
596
596
|
for (; funArgIt != funArgEit && csArgIt != csArgEit; funArgIt++, csArgIt++)
|
|
597
597
|
{
|
|
598
|
-
const
|
|
599
|
-
const
|
|
598
|
+
const SVFVar *cs_arg = *csArgIt;
|
|
599
|
+
const SVFVar *fun_arg = *funArgIt;
|
|
600
600
|
if (isInterestedPAGNode(fun_arg) && isInterestedPAGNode(cs_arg))
|
|
601
601
|
getInterVFEdgeAtIndCSFromAPToFP(cs_arg, fun_arg, callICFGNode, csId, edges);
|
|
602
602
|
}
|
|
@@ -604,12 +604,12 @@ void SVFG::getInterVFEdgesForIndirectCallSite(const CallICFGNode* callICFGNode,
|
|
|
604
604
|
if (callee->isVarArg())
|
|
605
605
|
{
|
|
606
606
|
NodeID varFunArg = pag->getVarargNode(callee);
|
|
607
|
-
const
|
|
607
|
+
const SVFVar* varFunArgNode = pag->getSVFVar(varFunArg);
|
|
608
608
|
if (isInterestedPAGNode(varFunArgNode))
|
|
609
609
|
{
|
|
610
610
|
for (; csArgIt != csArgEit; csArgIt++)
|
|
611
611
|
{
|
|
612
|
-
const
|
|
612
|
+
const SVFVar *cs_arg = *csArgIt;
|
|
613
613
|
if (isInterestedPAGNode(cs_arg))
|
|
614
614
|
getInterVFEdgeAtIndCSFromAPToFP(cs_arg, varFunArgNode, callICFGNode, csId, edges);
|
|
615
615
|
}
|
|
@@ -620,8 +620,8 @@ void SVFG::getInterVFEdgesForIndirectCallSite(const CallICFGNode* callICFGNode,
|
|
|
620
620
|
// Find inter direct return edges between actual return and formal return.
|
|
621
621
|
if (pag->funHasRet(callee) && pag->callsiteHasRet(retICFGNode))
|
|
622
622
|
{
|
|
623
|
-
const
|
|
624
|
-
const
|
|
623
|
+
const SVFVar* cs_return = pag->getCallSiteRet(retICFGNode);
|
|
624
|
+
const SVFVar* fun_return = pag->getFunRet(callee);
|
|
625
625
|
if (isInterestedPAGNode(cs_return) && isInterestedPAGNode(fun_return))
|
|
626
626
|
getInterVFEdgeAtIndCSFromFRToAR(fun_return, cs_return, csId, edges);
|
|
627
627
|
}
|
|
@@ -101,7 +101,7 @@ void ThreadCallGraph::updateCallGraph(PointerAnalysis* pta)
|
|
|
101
101
|
const NodeBS targets = pta->getPts(forkedval->getId()).toNodeBS();
|
|
102
102
|
for (NodeBS::iterator ii = targets.begin(), ie = targets.end(); ii != ie; ii++)
|
|
103
103
|
{
|
|
104
|
-
if(ObjVar* objPN =
|
|
104
|
+
if(const ObjVar* objPN = pag->getObjVar(*ii))
|
|
105
105
|
{
|
|
106
106
|
const BaseObjVar* obj = pag->getBaseObject(objPN->getId());
|
|
107
107
|
if(obj->isFunction())
|