svf-tools 1.0.371 → 1.0.375
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/Dockerfile +1 -1
- package/SVF-doxygen/html/html/AndersenSFR_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/AndersenStat_8cpp_source.html +5 -6
- package/SVF-doxygen/html/html/Andersen_8cpp_source.html +10 -10
- package/SVF-doxygen/html/html/CHGBuilder_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/Conditions_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/ConsGEdge_8h_source.html +1 -1
- package/SVF-doxygen/html/html/ConsG_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/ConsG_8h_source.html +7 -7
- package/SVF-doxygen/html/html/ContextDDA_8cpp_source.html +6 -6
- package/SVF-doxygen/html/html/DDAClient_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/DDAClient_8h_source.html +1 -1
- package/SVF-doxygen/html/html/DDAPass_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/DDAVFSolver_8h_source.html +15 -15
- package/SVF-doxygen/html/html/FlowDDA_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/FlowSensitiveStat_8cpp_source.html +7 -7
- package/SVF-doxygen/html/html/FlowSensitiveTBHC_8cpp_source.html +7 -7
- package/SVF-doxygen/html/html/FlowSensitive_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/Graph2Json_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/ICFG_8cpp_source.html +4 -10
- package/SVF-doxygen/html/html/IRAnnotator_8h_source.html +3 -3
- package/SVF-doxygen/html/html/IRGraph_8cpp_source.html +6 -6
- package/SVF-doxygen/html/html/IRGraph_8h_source.html +2 -2
- package/SVF-doxygen/html/html/LLVMUtil_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/LLVMUtil_8h.html +3 -3
- package/SVF-doxygen/html/html/LLVMUtil_8h_source.html +2 -2
- package/SVF-doxygen/html/html/LeakChecker_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/LocationSet_8cpp_source.html +11 -11
- package/SVF-doxygen/html/html/LocationSet_8h_source.html +10 -11
- package/SVF-doxygen/html/html/MemRegion_8cpp_source.html +10 -10
- package/SVF-doxygen/html/html/OfflineConsG_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/Options_8cpp_source.html +22 -21
- package/SVF-doxygen/html/html/Options_8h_source.html +22 -21
- package/SVF-doxygen/html/html/PAGBuilderFromFile_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/PTAStat_8cpp_source.html +17 -17
- package/SVF-doxygen/html/html/PathCondAllocator_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/PointerAnalysisImpl_8cpp_source.html +8 -8
- package/SVF-doxygen/html/html/PointerAnalysisImpl_8h_source.html +2 -2
- package/SVF-doxygen/html/html/PointerAnalysis_8cpp_source.html +11 -11
- package/SVF-doxygen/html/html/PointerAnalysis_8h_source.html +14 -14
- package/SVF-doxygen/html/html/SVFG_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/SVFIRBuilder_8cpp_source.html +8 -10
- package/SVF-doxygen/html/html/SVFIRBuilder_8h_source.html +72 -73
- package/SVF-doxygen/html/html/SVFIR_8cpp_source.html +37 -35
- package/SVF-doxygen/html/html/SVFIR_8h_source.html +66 -68
- package/SVF-doxygen/html/html/SVFModule_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/SVFStatements_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/SVFStatements_8h_source.html +5 -5
- package/SVF-doxygen/html/html/SVFUtil_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/SVFVariables_8cpp_source.html +18 -19
- package/SVF-doxygen/html/html/SVFVariables_8h_source.html +121 -127
- package/SVF-doxygen/html/html/SaberSVFGBuilder_8cpp_source.html +6 -6
- package/SVF-doxygen/html/html/SrcSnkDDA_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/SymbolTableBuilder_8cpp_source.html +39 -30
- package/SVF-doxygen/html/html/SymbolTableBuilder_8h_source.html +10 -7
- package/SVF-doxygen/html/html/SymbolTableInfo_8cpp_source.html +93 -53
- package/SVF-doxygen/html/html/SymbolTableInfo_8h_source.html +82 -85
- package/SVF-doxygen/html/html/ThreadCallGraph_8cpp_source.html +5 -5
- package/SVF-doxygen/html/html/TypeAnalysis_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/TypeBasedHeapCloning_8cpp_source.html +17 -16
- package/SVF-doxygen/html/html/TypeBasedHeapCloning_8h_source.html +1 -1
- package/SVF-doxygen/html/html/VFGNode_8h_source.html +2 -2
- package/SVF-doxygen/html/html/VFG_8cpp_source.html +7 -7
- package/SVF-doxygen/html/html/VFG_8h_source.html +2 -2
- package/SVF-doxygen/html/html/VersionedFlowSensitiveStat_8cpp_source.html +4 -4
- package/SVF-doxygen/html/html/VersionedFlowSensitive_8cpp_source.html +4 -4
- package/SVF-doxygen/html/html/WPAPass_8cpp_source.html +5 -5
- package/SVF-doxygen/html/html/classSVF_1_1ActualParmVFGNode.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1ActualRetVFGNode.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AliasDDAClient.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1Andersen.html +8 -8
- package/SVF-doxygen/html/html/classSVF_1_1AndersenBase.html +8 -8
- package/SVF-doxygen/html/html/classSVF_1_1AndersenSFR.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1AndersenStat.html +5 -6
- package/SVF-doxygen/html/html/classSVF_1_1ArgumentVFGNode.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1BVDataPTAImpl.html +12 -13
- package/SVF-doxygen/html/html/classSVF_1_1BinaryOPVFGNode.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1BranchCondManager.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1BranchStmt.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1CHGBuilder.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1CloneDummyObjVar-members.html +22 -25
- package/SVF-doxygen/html/html/classSVF_1_1CloneDummyObjVar.html +16 -25
- package/SVF-doxygen/html/html/classSVF_1_1CloneFIObjVar-members.html +22 -25
- package/SVF-doxygen/html/html/classSVF_1_1CloneFIObjVar.html +17 -26
- package/SVF-doxygen/html/html/classSVF_1_1CloneGepObjVar-members.html +23 -26
- package/SVF-doxygen/html/html/classSVF_1_1CloneGepObjVar.html +17 -26
- package/SVF-doxygen/html/html/classSVF_1_1CmpVFGNode.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1CondPTAImpl.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1ConstraintGraph.html +5 -5
- package/SVF-doxygen/html/html/classSVF_1_1ContextDDA.html +6 -6
- package/SVF-doxygen/html/html/classSVF_1_1DDAClient.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1DDAPass.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1DDAVFSolver.html +12 -12
- package/SVF-doxygen/html/html/classSVF_1_1DummyObjVar-members.html +22 -25
- package/SVF-doxygen/html/html/classSVF_1_1DummyObjVar.html +18 -27
- package/SVF-doxygen/html/html/classSVF_1_1DummyValVar-members.html +21 -24
- package/SVF-doxygen/html/html/classSVF_1_1DummyValVar.html +18 -27
- package/SVF-doxygen/html/html/classSVF_1_1FIObjVar-members.html +22 -25
- package/SVF-doxygen/html/html/classSVF_1_1FIObjVar.html +19 -28
- package/SVF-doxygen/html/html/classSVF_1_1FlowDDA.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitive.html +10 -10
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveStat.html +8 -8
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveTBHC.html +17 -17
- package/SVF-doxygen/html/html/classSVF_1_1FormalParmVFGNode.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FormalRetVFGNode.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FunptrDDAClient.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1GepObjVar-members.html +24 -27
- package/SVF-doxygen/html/html/classSVF_1_1GepObjVar.html +42 -51
- package/SVF-doxygen/html/html/classSVF_1_1GepStmt.html +12 -12
- package/SVF-doxygen/html/html/classSVF_1_1GepValVar-members.html +30 -35
- package/SVF-doxygen/html/html/classSVF_1_1GepValVar.html +34 -106
- package/SVF-doxygen/html/html/classSVF_1_1ICFGPrinter.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1IRGraph.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1InterPHIVFGNode.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1IntraPHIVFGNode.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1LeakChecker.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1LocationSet-members.html +15 -16
- package/SVF-doxygen/html/html/classSVF_1_1LocationSet.html +47 -81
- package/SVF-doxygen/html/html/classSVF_1_1MRGenerator.html +12 -12
- package/SVF-doxygen/html/html/classSVF_1_1MemObj.html +87 -87
- package/SVF-doxygen/html/html/classSVF_1_1NormalGepCGEdge.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1NullPtrVFGNode.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1ObjTypeInfo-members.html +7 -8
- package/SVF-doxygen/html/html/classSVF_1_1ObjTypeInfo.html +162 -211
- package/SVF-doxygen/html/html/classSVF_1_1ObjVar-members.html +22 -25
- package/SVF-doxygen/html/html/classSVF_1_1ObjVar.html +23 -32
- package/SVF-doxygen/html/html/classSVF_1_1OfflineConsG.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1Options-members.html +55 -54
- package/SVF-doxygen/html/html/classSVF_1_1Options.html +47 -21
- package/SVF-doxygen/html/html/classSVF_1_1PAGBuilderFromFile.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1PHIVFGNode.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1PTAStat.html +18 -18
- package/SVF-doxygen/html/html/classSVF_1_1PathCondAllocator.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1PointerAnalysis.html +30 -30
- package/SVF-doxygen/html/html/classSVF_1_1RetPN-members.html +22 -25
- package/SVF-doxygen/html/html/classSVF_1_1RetPN.html +18 -27
- package/SVF-doxygen/html/html/classSVF_1_1SVFG.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1SVFIR-members.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1SVFIR.html +215 -227
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder-members.html +82 -83
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +582 -529
- package/SVF-doxygen/html/html/classSVF_1_1SVFModule.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1SVFVar-members.html +23 -26
- package/SVF-doxygen/html/html/classSVF_1_1SVFVar.html +54 -151
- package/SVF-doxygen/html/html/classSVF_1_1SaberSVFGBuilder.html +6 -6
- package/SVF-doxygen/html/html/classSVF_1_1SrcSnkDDA.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1StInfo.html +43 -43
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableBuilder-members.html +10 -7
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableBuilder.html +182 -72
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo-members.html +9 -11
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo.html +131 -162
- package/SVF-doxygen/html/html/classSVF_1_1ThreadCallGraph.html +5 -5
- package/SVF-doxygen/html/html/classSVF_1_1TypeAnalysis.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1TypeBasedHeapCloning.html +26 -25
- package/SVF-doxygen/html/html/classSVF_1_1UnaryOPVFGNode.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1VFG.html +8 -8
- package/SVF-doxygen/html/html/classSVF_1_1ValVar-members.html +21 -24
- package/SVF-doxygen/html/html/classSVF_1_1ValVar.html +16 -25
- package/SVF-doxygen/html/html/classSVF_1_1VarArgPN-members.html +22 -25
- package/SVF-doxygen/html/html/classSVF_1_1VarArgPN.html +18 -27
- package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitive.html +7 -7
- package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitiveStat.html +5 -5
- package/SVF-doxygen/html/html/classSVF_1_1WPAPass.html +12 -12
- package/SVF-doxygen/html/html/functions_a.html +24 -24
- package/SVF-doxygen/html/html/functions_c.html +1 -1
- package/SVF-doxygen/html/html/functions_f.html +19 -22
- package/SVF-doxygen/html/html/functions_func.html +24 -24
- package/SVF-doxygen/html/html/functions_func_c.html +1 -1
- package/SVF-doxygen/html/html/functions_func_g.html +20 -23
- package/SVF-doxygen/html/html/functions_func_h.html +1 -1
- package/SVF-doxygen/html/html/functions_func_i.html +11 -17
- package/SVF-doxygen/html/html/functions_func_l.html +2 -2
- package/SVF-doxygen/html/html/functions_func_o.html +4 -4
- package/SVF-doxygen/html/html/functions_func_r.html +5 -2
- package/SVF-doxygen/html/html/functions_g.html +18 -21
- package/SVF-doxygen/html/html/functions_h.html +1 -1
- package/SVF-doxygen/html/html/functions_i.html +12 -21
- package/SVF-doxygen/html/html/functions_l.html +8 -8
- package/SVF-doxygen/html/html/functions_m.html +4 -1
- package/SVF-doxygen/html/html/functions_o.html +22 -18
- package/SVF-doxygen/html/html/functions_p.html +3 -3
- package/SVF-doxygen/html/html/functions_r.html +5 -2
- package/SVF-doxygen/html/html/functions_rela.html +2 -1
- package/SVF-doxygen/html/html/functions_s.html +6 -5
- package/SVF-doxygen/html/html/functions_t.html +4 -4
- package/SVF-doxygen/html/html/functions_v.html +3 -3
- package/SVF-doxygen/html/html/functions_vars_f.html +0 -3
- package/SVF-doxygen/html/html/functions_vars_i.html +3 -6
- package/SVF-doxygen/html/html/functions_vars_m.html +3 -0
- package/SVF-doxygen/html/html/namespaceSVF.html +1 -1
- package/SVF-doxygen/html/html/namespaceSVF_1_1SVFUtil.html +8 -8
- package/SVF-doxygen/html/html/namespacemembers_func.html +1 -1
- package/SVF-doxygen/html/html/namespacemembers_s.html +1 -1
- package/SVF-doxygen/html/html/search/all_1.js +22 -22
- package/SVF-doxygen/html/html/search/all_10.js +4 -4
- package/SVF-doxygen/html/html/search/all_12.js +5 -4
- package/SVF-doxygen/html/html/search/all_13.js +6 -6
- package/SVF-doxygen/html/html/search/all_14.js +4 -4
- package/SVF-doxygen/html/html/search/all_15.js +1 -1
- package/SVF-doxygen/html/html/search/all_16.js +1 -1
- package/SVF-doxygen/html/html/search/all_3.js +1 -1
- package/SVF-doxygen/html/html/search/all_6.js +0 -1
- package/SVF-doxygen/html/html/search/all_7.js +9 -9
- package/SVF-doxygen/html/html/search/all_8.js +1 -1
- package/SVF-doxygen/html/html/search/all_9.js +2 -5
- package/SVF-doxygen/html/html/search/all_c.js +4 -4
- package/SVF-doxygen/html/html/search/all_d.js +1 -0
- package/SVF-doxygen/html/html/search/all_e.js +3 -3
- package/SVF-doxygen/html/html/search/all_f.js +3 -3
- package/SVF-doxygen/html/html/search/functions_0.js +22 -22
- package/SVF-doxygen/html/html/search/functions_10.js +2 -2
- package/SVF-doxygen/html/html/search/functions_2.js +1 -1
- package/SVF-doxygen/html/html/search/functions_6.js +9 -9
- package/SVF-doxygen/html/html/search/functions_7.js +1 -1
- package/SVF-doxygen/html/html/search/functions_8.js +1 -3
- package/SVF-doxygen/html/html/search/functions_a.js +1 -1
- package/SVF-doxygen/html/html/search/functions_d.js +1 -1
- package/SVF-doxygen/html/html/search/functions_e.js +1 -1
- package/SVF-doxygen/html/html/search/functions_f.js +1 -0
- package/SVF-doxygen/html/html/search/related_9.js +1 -1
- package/SVF-doxygen/html/html/search/variables_14.js +2 -2
- package/SVF-doxygen/html/html/search/variables_15.js +1 -1
- package/SVF-doxygen/html/html/search/variables_6.js +0 -1
- package/SVF-doxygen/html/html/search/variables_9.js +1 -2
- package/SVF-doxygen/html/html/search/variables_d.js +1 -0
- package/SVF-doxygen/html/html/search/variables_e.js +2 -2
- package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01ConstraintGraph_01_5_01_4.html +1 -1
- package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01ICFG_01_5_01_4.html +7 -21
- package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01IRGraph_01_5_01_4.html +3 -3
- package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01OfflineConsG_01_5_01_4.html +1 -1
- package/SVF-doxygen/html/html/structstd_1_1hash_3_01SVF_1_1LocationSet_01_4.html +4 -4
- package/SVF-doxygen/html/html/svf-ex_8cpp.html +2 -2
- package/SVF-doxygen/html/html/svf-ex_8cpp_source.html +2 -2
- package/include/MemoryModel/LocationSet.h +0 -6
- package/include/MemoryModel/SVFIR.h +5 -37
- package/include/MemoryModel/SVFStatements.h +1 -1
- package/include/MemoryModel/SVFVariables.h +4 -21
- package/include/MemoryModel/SymbolTableInfo.h +8 -24
- package/include/SVF-FE/LLVMUtil.h +1 -1
- package/include/SVF-FE/SVFIRBuilder.h +91 -108
- package/include/SVF-FE/SymbolTableBuilder.h +9 -2
- package/include/Util/Options.h +1 -0
- package/lib/Graphs/ICFG.cpp +1 -47
- package/lib/MemoryModel/LocationSet.cpp +7 -3
- package/lib/MemoryModel/PointerAnalysisImpl.cpp +1 -1
- package/lib/MemoryModel/SVFIR.cpp +67 -19
- package/lib/MemoryModel/SVFVariables.cpp +6 -13
- package/lib/MemoryModel/SymbolTableInfo.cpp +57 -68
- package/lib/SVF-FE/LLVMUtil.cpp +3 -3
- package/lib/SVF-FE/SVFIRBuilder.cpp +83 -136
- package/lib/SVF-FE/SymbolTableBuilder.cpp +81 -23
- package/lib/Util/Options.cpp +6 -0
- package/lib/Util/TypeBasedHeapCloning.cpp +1 -1
- package/lib/WPA/AndersenStat.cpp +1 -1
- package/package.json +1 -1
|
@@ -53,7 +53,7 @@ AddrStmt* SVFIR::addAddrStmt(NodeID src, NodeID dst)
|
|
|
53
53
|
SVFVar* srcNode = getGNode(src);
|
|
54
54
|
SVFVar* dstNode = getGNode(dst);
|
|
55
55
|
if(SVFStmt* edge = hasNonlabeledEdge(srcNode,dstNode, SVFStmt::Addr))
|
|
56
|
-
return
|
|
56
|
+
return nullptr;
|
|
57
57
|
else
|
|
58
58
|
{
|
|
59
59
|
AddrStmt* addrPE = new AddrStmt(srcNode, dstNode);
|
|
@@ -71,7 +71,7 @@ CopyStmt* SVFIR::addCopyStmt(NodeID src, NodeID dst)
|
|
|
71
71
|
SVFVar* srcNode = getGNode(src);
|
|
72
72
|
SVFVar* dstNode = getGNode(dst);
|
|
73
73
|
if(SVFStmt* edge = hasNonlabeledEdge(srcNode,dstNode, SVFStmt::Copy))
|
|
74
|
-
return
|
|
74
|
+
return nullptr;
|
|
75
75
|
else
|
|
76
76
|
{
|
|
77
77
|
CopyStmt* copyPE = new CopyStmt(srcNode, dstNode);
|
|
@@ -113,7 +113,7 @@ SelectStmt* SVFIR::addSelectStmt(NodeID res, NodeID op1, NodeID op2, NodeID cond
|
|
|
113
113
|
SVFVar* dstNode = getGNode(res);
|
|
114
114
|
SVFVar* condNode = getGNode(cond);
|
|
115
115
|
if(SVFStmt* edge = hasLabeledEdge(op1Node, dstNode, SVFStmt::Select, op2Node))
|
|
116
|
-
return
|
|
116
|
+
return nullptr;
|
|
117
117
|
else
|
|
118
118
|
{
|
|
119
119
|
std::vector<SVFVar*> opnds = {op1Node, op2Node};
|
|
@@ -133,7 +133,7 @@ CmpStmt* SVFIR::addCmpStmt(NodeID op1, NodeID op2, NodeID dst, u32_t predicate)
|
|
|
133
133
|
SVFVar* op2Node = getGNode(op2);
|
|
134
134
|
SVFVar* dstNode = getGNode(dst);
|
|
135
135
|
if(SVFStmt* edge = hasLabeledEdge(op1Node, dstNode, SVFStmt::Cmp, op2Node))
|
|
136
|
-
return
|
|
136
|
+
return nullptr;
|
|
137
137
|
else
|
|
138
138
|
{
|
|
139
139
|
std::vector<SVFVar*> opnds = {op1Node, op2Node};
|
|
@@ -154,7 +154,7 @@ BinaryOPStmt* SVFIR::addBinaryOPStmt(NodeID op1, NodeID op2, NodeID dst, u32_t o
|
|
|
154
154
|
SVFVar* op2Node = getGNode(op2);
|
|
155
155
|
SVFVar* dstNode = getGNode(dst);
|
|
156
156
|
if(SVFStmt* edge = hasLabeledEdge(op1Node, dstNode, SVFStmt::BinaryOp, op2Node))
|
|
157
|
-
return
|
|
157
|
+
return nullptr;
|
|
158
158
|
else
|
|
159
159
|
{
|
|
160
160
|
std::vector<SVFVar*> opnds = {op1Node, op2Node};
|
|
@@ -173,7 +173,7 @@ UnaryOPStmt* SVFIR::addUnaryOPStmt(NodeID src, NodeID dst, u32_t opcode)
|
|
|
173
173
|
SVFVar* srcNode = getGNode(src);
|
|
174
174
|
SVFVar* dstNode = getGNode(dst);
|
|
175
175
|
if(SVFStmt* edge = hasNonlabeledEdge(srcNode,dstNode, SVFStmt::UnaryOp))
|
|
176
|
-
return
|
|
176
|
+
return nullptr;
|
|
177
177
|
else
|
|
178
178
|
{
|
|
179
179
|
UnaryOPStmt* unaryOP = new UnaryOPStmt(srcNode, dstNode, opcode);
|
|
@@ -191,7 +191,7 @@ BranchStmt* SVFIR::addBranchStmt(NodeID br, NodeID cond, const BranchStmt::SuccA
|
|
|
191
191
|
SVFVar* brNode = getGNode(br);
|
|
192
192
|
SVFVar* condNode = getGNode(cond);
|
|
193
193
|
if(SVFStmt* edge = hasNonlabeledEdge(condNode,brNode, SVFStmt::Branch))
|
|
194
|
-
return
|
|
194
|
+
return nullptr;
|
|
195
195
|
else
|
|
196
196
|
{
|
|
197
197
|
BranchStmt* branch = new BranchStmt(brNode, condNode, succs);
|
|
@@ -209,7 +209,7 @@ LoadStmt* SVFIR::addLoadStmt(NodeID src, NodeID dst)
|
|
|
209
209
|
SVFVar* srcNode = getGNode(src);
|
|
210
210
|
SVFVar* dstNode = getGNode(dst);
|
|
211
211
|
if(SVFStmt* edge = hasNonlabeledEdge(srcNode,dstNode, SVFStmt::Load))
|
|
212
|
-
return
|
|
212
|
+
return nullptr;
|
|
213
213
|
else
|
|
214
214
|
{
|
|
215
215
|
LoadStmt* loadPE = new LoadStmt(srcNode, dstNode);
|
|
@@ -228,7 +228,7 @@ StoreStmt* SVFIR::addStoreStmt(NodeID src, NodeID dst, const IntraICFGNode* curV
|
|
|
228
228
|
SVFVar* srcNode = getGNode(src);
|
|
229
229
|
SVFVar* dstNode = getGNode(dst);
|
|
230
230
|
if(SVFStmt* edge = hasLabeledEdge(srcNode,dstNode, SVFStmt::Store, curVal))
|
|
231
|
-
return
|
|
231
|
+
return nullptr;
|
|
232
232
|
else
|
|
233
233
|
{
|
|
234
234
|
StoreStmt* storePE = new StoreStmt(srcNode, dstNode, curVal);
|
|
@@ -246,7 +246,7 @@ CallPE* SVFIR::addCallPE(NodeID src, NodeID dst, const CallICFGNode* cs, const F
|
|
|
246
246
|
SVFVar* srcNode = getGNode(src);
|
|
247
247
|
SVFVar* dstNode = getGNode(dst);
|
|
248
248
|
if(SVFStmt* edge = hasLabeledEdge(srcNode,dstNode, SVFStmt::Call, cs))
|
|
249
|
-
return
|
|
249
|
+
return nullptr;
|
|
250
250
|
else
|
|
251
251
|
{
|
|
252
252
|
CallPE* callPE = new CallPE(srcNode, dstNode, cs,entry);
|
|
@@ -264,7 +264,7 @@ RetPE* SVFIR::addRetPE(NodeID src, NodeID dst, const CallICFGNode* cs, const Fun
|
|
|
264
264
|
SVFVar* srcNode = getGNode(src);
|
|
265
265
|
SVFVar* dstNode = getGNode(dst);
|
|
266
266
|
if(SVFStmt* edge = hasLabeledEdge(srcNode,dstNode, SVFStmt::Ret, cs))
|
|
267
|
-
return
|
|
267
|
+
return nullptr;
|
|
268
268
|
else
|
|
269
269
|
{
|
|
270
270
|
RetPE* retPE = new RetPE(srcNode, dstNode, cs, exit);
|
|
@@ -293,7 +293,7 @@ TDForkPE* SVFIR::addThreadForkPE(NodeID src, NodeID dst, const CallICFGNode* cs,
|
|
|
293
293
|
SVFVar* srcNode = getGNode(src);
|
|
294
294
|
SVFVar* dstNode = getGNode(dst);
|
|
295
295
|
if(SVFStmt* edge = hasLabeledEdge(srcNode,dstNode, SVFStmt::ThreadFork, cs))
|
|
296
|
-
return
|
|
296
|
+
return nullptr;
|
|
297
297
|
else
|
|
298
298
|
{
|
|
299
299
|
TDForkPE* forkPE = new TDForkPE(srcNode, dstNode, cs, entry);
|
|
@@ -311,7 +311,7 @@ TDJoinPE* SVFIR::addThreadJoinPE(NodeID src, NodeID dst, const CallICFGNode* cs,
|
|
|
311
311
|
SVFVar* srcNode = getGNode(src);
|
|
312
312
|
SVFVar* dstNode = getGNode(dst);
|
|
313
313
|
if(SVFStmt* edge = hasLabeledEdge(srcNode,dstNode, SVFStmt::ThreadJoin, cs))
|
|
314
|
-
return
|
|
314
|
+
return nullptr;
|
|
315
315
|
else
|
|
316
316
|
{
|
|
317
317
|
TDJoinPE* joinPE = new TDJoinPE(srcNode, dstNode, cs, exit);
|
|
@@ -352,7 +352,7 @@ GepStmt* SVFIR::addNormalGepStmt(NodeID src, NodeID dst, const LocationSet& ls)
|
|
|
352
352
|
SVFVar* baseNode = getGNode(getBaseValVar(src));
|
|
353
353
|
SVFVar* dstNode = getGNode(dst);
|
|
354
354
|
if(SVFStmt* edge = hasNonlabeledEdge(baseNode, dstNode, SVFStmt::Gep))
|
|
355
|
-
return
|
|
355
|
+
return nullptr;
|
|
356
356
|
else
|
|
357
357
|
{
|
|
358
358
|
GepStmt* gepPE = new GepStmt(baseNode, dstNode, baseLS+ls);
|
|
@@ -372,7 +372,7 @@ GepStmt* SVFIR::addVariantGepStmt(NodeID src, NodeID dst, const LocationSet& ls)
|
|
|
372
372
|
SVFVar* baseNode = getGNode(getBaseValVar(src));
|
|
373
373
|
SVFVar* dstNode = getGNode(dst);
|
|
374
374
|
if(SVFStmt* edge = hasNonlabeledEdge(baseNode, dstNode, SVFStmt::Gep))
|
|
375
|
-
return
|
|
375
|
+
return nullptr;
|
|
376
376
|
else
|
|
377
377
|
{
|
|
378
378
|
GepStmt* gepPE = new GepStmt(baseNode, dstNode,baseLS+ls, true);
|
|
@@ -388,14 +388,14 @@ GepStmt* SVFIR::addVariantGepStmt(NodeID src, NodeID dst, const LocationSet& ls)
|
|
|
388
388
|
* Add a temp field value node, this method can only invoked by getGepValVar
|
|
389
389
|
* due to constaint expression, curInst is used to distinguish different instructions (e.g., memorycpy) when creating GepValVar.
|
|
390
390
|
*/
|
|
391
|
-
NodeID SVFIR::addGepValNode(const Value* curInst,const Value* gepVal, const LocationSet& ls, NodeID i, const Type *type
|
|
391
|
+
NodeID SVFIR::addGepValNode(const Value* curInst,const Value* gepVal, const LocationSet& ls, NodeID i, const Type *type)
|
|
392
392
|
{
|
|
393
393
|
NodeID base = getBaseValVar(getValueNode(gepVal));
|
|
394
394
|
//assert(findPAGNode(i) == false && "this node should not be created before");
|
|
395
395
|
assert(0==GepValObjMap[curInst].count(std::make_pair(base, ls))
|
|
396
396
|
&& "this node should not be created before");
|
|
397
397
|
GepValObjMap[curInst][std::make_pair(base, ls)] = i;
|
|
398
|
-
GepValVar *node = new GepValVar(gepVal, i, ls, type
|
|
398
|
+
GepValVar *node = new GepValVar(gepVal, i, ls, type);
|
|
399
399
|
return addValNode(gepVal, node, i);
|
|
400
400
|
}
|
|
401
401
|
|
|
@@ -537,6 +537,24 @@ NodeID SVFIR::getBaseValVar(NodeID nodeId)
|
|
|
537
537
|
return nodeId;
|
|
538
538
|
}
|
|
539
539
|
|
|
540
|
+
/*!
|
|
541
|
+
* It is used to create a dummy GepValVar during global initiailzation.
|
|
542
|
+
*/
|
|
543
|
+
NodeID SVFIR::getGepValVar(const Value* curInst, NodeID base, const LocationSet& ls) const
|
|
544
|
+
{
|
|
545
|
+
GepValueVarMap::const_iterator iter = GepValObjMap.find(curInst);
|
|
546
|
+
if(iter==GepValObjMap.end()){
|
|
547
|
+
return UINT_MAX;
|
|
548
|
+
}
|
|
549
|
+
else{
|
|
550
|
+
NodeLocationSetMap::const_iterator lit = iter->second.find(std::make_pair(base, ls));
|
|
551
|
+
if(lit==iter->second.end())
|
|
552
|
+
return UINT_MAX;
|
|
553
|
+
else
|
|
554
|
+
return lit->second;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
|
|
540
558
|
/*!
|
|
541
559
|
* Get a base SVFVar given a pointer
|
|
542
560
|
* Return the source node of its connected normal gep edge
|
|
@@ -669,7 +687,37 @@ void SVFIR::initialiseCandidatePointers()
|
|
|
669
687
|
candidatePointers.insert(nodeId);
|
|
670
688
|
}
|
|
671
689
|
}
|
|
672
|
-
|
|
690
|
+
/*!
|
|
691
|
+
* Return true if FIObjVar can point to any object
|
|
692
|
+
* Or a field GepObjVar can point to any object.
|
|
693
|
+
*/
|
|
694
|
+
bool SVFIR::isNonPointerObj(NodeID id) const
|
|
695
|
+
{
|
|
696
|
+
SVFVar* node = getGNode(id);
|
|
697
|
+
if (const FIObjVar* fiNode = SVFUtil::dyn_cast<FIObjVar>(node))
|
|
698
|
+
{
|
|
699
|
+
if(Options::FirstFieldEqBase)
|
|
700
|
+
return fiNode->getMemObj()->isNonPtrFieldObj(0);
|
|
701
|
+
else
|
|
702
|
+
return (fiNode->getMemObj()->hasPtrObj()==false);
|
|
703
|
+
}
|
|
704
|
+
else if (const GepObjVar* gepNode = SVFUtil::dyn_cast<GepObjVar>(node))
|
|
705
|
+
{
|
|
706
|
+
return (gepNode->getMemObj()->isNonPtrFieldObj(gepNode->getLocationSet()));
|
|
707
|
+
}
|
|
708
|
+
else if (const DummyObjVar* dummyNode = SVFUtil::dyn_cast<DummyObjVar>(node))
|
|
709
|
+
{
|
|
710
|
+
if(Options::FirstFieldEqBase)
|
|
711
|
+
return dummyNode->getMemObj()->isNonPtrFieldObj(0);
|
|
712
|
+
else
|
|
713
|
+
return (dummyNode->getMemObj()->hasPtrObj()==false);
|
|
714
|
+
}
|
|
715
|
+
else
|
|
716
|
+
{
|
|
717
|
+
assert(false && "expecting a object node");
|
|
718
|
+
abort();
|
|
719
|
+
}
|
|
720
|
+
}
|
|
673
721
|
/*
|
|
674
722
|
* If this is a dummy node or node does not have incoming edges we assume it is not a pointer here
|
|
675
723
|
*/
|
|
@@ -683,7 +731,7 @@ bool SVFIR::isValidPointer(NodeID nodeId) const
|
|
|
683
731
|
|
|
684
732
|
bool SVFIR::isValidTopLevelPtr(const SVFVar* node)
|
|
685
733
|
{
|
|
686
|
-
if (node
|
|
734
|
+
if (SVFUtil::isa<ValVar>(node))
|
|
687
735
|
{
|
|
688
736
|
if (isValidPointer(node->getId()) && node->hasValue())
|
|
689
737
|
{
|
|
@@ -40,36 +40,28 @@ using namespace SVFUtil;
|
|
|
40
40
|
SVFVar::SVFVar(const Value* val, NodeID i, PNODEK k) :
|
|
41
41
|
GenericPAGNodeTy(i,k), value(val)
|
|
42
42
|
{
|
|
43
|
-
|
|
44
43
|
assert( ValNode <= k && k <= CloneDummyObjNode && "new SVFIR node kind?");
|
|
45
|
-
|
|
46
44
|
switch (k)
|
|
47
45
|
{
|
|
48
46
|
case ValNode:
|
|
49
47
|
case GepValNode:
|
|
50
48
|
{
|
|
51
49
|
assert(val != nullptr && "value is nullptr for ValVar or GepValNode");
|
|
52
|
-
|
|
53
|
-
isATPointer = false;
|
|
50
|
+
isPtr = val->getType()->isPointerTy();
|
|
54
51
|
break;
|
|
55
52
|
}
|
|
56
|
-
|
|
57
53
|
case RetNode:
|
|
58
54
|
{
|
|
59
55
|
assert(val != nullptr && "value is nullptr for RetNode");
|
|
60
|
-
|
|
61
|
-
isATPointer = false;
|
|
56
|
+
isPtr = SVFUtil::cast<Function>(val)->getReturnType()->isPointerTy();
|
|
62
57
|
break;
|
|
63
58
|
}
|
|
64
|
-
|
|
65
59
|
case VarargNode:
|
|
66
60
|
case DummyValNode:
|
|
67
61
|
{
|
|
68
|
-
|
|
69
|
-
isATPointer = false;
|
|
62
|
+
isPtr = true;
|
|
70
63
|
break;
|
|
71
64
|
}
|
|
72
|
-
|
|
73
65
|
case ObjNode:
|
|
74
66
|
case GepObjNode:
|
|
75
67
|
case FIObjNode:
|
|
@@ -78,8 +70,9 @@ SVFVar::SVFVar(const Value* val, NodeID i, PNODEK k) :
|
|
|
78
70
|
case CloneFIObjNode:
|
|
79
71
|
case CloneDummyObjNode:
|
|
80
72
|
{
|
|
81
|
-
|
|
82
|
-
|
|
73
|
+
isPtr = true;
|
|
74
|
+
if(val)
|
|
75
|
+
isPtr = val->getType()->isPointerTy();
|
|
83
76
|
break;
|
|
84
77
|
}
|
|
85
78
|
}
|
|
@@ -44,6 +44,17 @@ SymbolTableInfo* SymbolTableInfo::symInfo = nullptr;
|
|
|
44
44
|
u32_t StInfo::maxFieldLimit = 0;
|
|
45
45
|
|
|
46
46
|
|
|
47
|
+
ObjTypeInfo::ObjTypeInfo(const Type* t, u32_t max) : type(t), flags(0), maxOffsetLimit(max)
|
|
48
|
+
{
|
|
49
|
+
assert(t && "no type information for this object?");
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
void ObjTypeInfo::resetTypeForHeapStaticObj(const Type* t){
|
|
54
|
+
assert((isStaticObj() || isHeap()) && "can only reset the inferred type for heap and static objects!");
|
|
55
|
+
type = t;
|
|
56
|
+
}
|
|
57
|
+
|
|
47
58
|
/// Add field (index and offset) with its corresponding type
|
|
48
59
|
void StInfo::addFldWithType(u32_t fldIdx, const Type* type, u32_t elemIdx)
|
|
49
60
|
{
|
|
@@ -90,8 +101,11 @@ SymbolTableInfo::TypeToFieldInfoMap::iterator SymbolTableInfo::getStructInfoIter
|
|
|
90
101
|
*/
|
|
91
102
|
ObjTypeInfo* SymbolTableInfo::createObjTypeInfo(const Type* type)
|
|
92
103
|
{
|
|
93
|
-
ObjTypeInfo* typeInfo = new ObjTypeInfo(StInfo::getMaxFieldLimit()
|
|
94
|
-
|
|
104
|
+
ObjTypeInfo* typeInfo = new ObjTypeInfo(type, StInfo::getMaxFieldLimit());
|
|
105
|
+
if(type && type->isPointerTy()){
|
|
106
|
+
typeInfo->setFlag(ObjTypeInfo::HEAP_OBJ);
|
|
107
|
+
typeInfo->setFlag(ObjTypeInfo::HASPTR_OBJ);
|
|
108
|
+
}
|
|
95
109
|
return typeInfo;
|
|
96
110
|
}
|
|
97
111
|
|
|
@@ -140,10 +154,19 @@ void SymbolTableInfo::collectArrayInfo(const ArrayType* ty)
|
|
|
140
154
|
StInfo* stinfo = new StInfo(totalElemNum);
|
|
141
155
|
typeToFieldInfo[ty] = stinfo;
|
|
142
156
|
|
|
157
|
+
/// array without any element (this is not true in C/C++ arrays) we assume there is an empty dummy element
|
|
158
|
+
if(totalElemNum==0){
|
|
159
|
+
stinfo->addFldWithType(0, elemTy, 0);
|
|
160
|
+
stinfo->setNumOfFieldsAndElems(1, 1);
|
|
161
|
+
FlattenedFieldInfo field(0, elemTy);
|
|
162
|
+
stinfo->getFlattenedFieldInfoVec().push_back(field);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
|
|
143
166
|
/// Array's flatten field infor is the same as its element's
|
|
144
167
|
/// flatten infor.
|
|
145
168
|
StInfo* elemStInfo = getStructInfo(elemTy);
|
|
146
|
-
u32_t nfE = elemStInfo->
|
|
169
|
+
u32_t nfE = elemStInfo->getNumOfFlattenFields();
|
|
147
170
|
for (u32_t j = 0; j < nfE; j++)
|
|
148
171
|
{
|
|
149
172
|
u32_t idx = elemStInfo->getFlattenedFieldInfoVec()[j].getFlattenFldIdx();
|
|
@@ -186,7 +209,7 @@ void SymbolTableInfo::collectStructInfo(const StructType *sty)
|
|
|
186
209
|
if (SVFUtil::isa<StructType>(et) || SVFUtil::isa<ArrayType>(et))
|
|
187
210
|
{
|
|
188
211
|
StInfo * subStinfo = getStructInfo(et);
|
|
189
|
-
u32_t nfE = subStinfo->
|
|
212
|
+
u32_t nfE = subStinfo->getNumOfFlattenFields();
|
|
190
213
|
//Copy ST's info, whose element 0 is the size of ST itself.
|
|
191
214
|
for (u32_t j = 0; j < nfE; j++)
|
|
192
215
|
{
|
|
@@ -351,7 +374,7 @@ MemObj* SymbolTableInfo::createBlkObj(SymID symId)
|
|
|
351
374
|
{
|
|
352
375
|
assert(isBlkObj(symId));
|
|
353
376
|
assert(objMap.find(symId)==objMap.end());
|
|
354
|
-
MemObj* obj = new MemObj(symId, createObjTypeInfo());
|
|
377
|
+
MemObj* obj = new MemObj(symId, createObjTypeInfo(IntegerType::get(LLVMModuleSet::getLLVMModuleSet()->getContext(), 32)));
|
|
355
378
|
objMap[symId] = obj;
|
|
356
379
|
return obj;
|
|
357
380
|
}
|
|
@@ -360,7 +383,7 @@ MemObj* SymbolTableInfo::createConstantObj(SymID symId)
|
|
|
360
383
|
{
|
|
361
384
|
assert(isConstantObj(symId));
|
|
362
385
|
assert(objMap.find(symId)==objMap.end());
|
|
363
|
-
MemObj* obj = new MemObj(symId, createObjTypeInfo());
|
|
386
|
+
MemObj* obj = new MemObj(symId, createObjTypeInfo(IntegerType::get(LLVMModuleSet::getLLVMModuleSet()->getContext(), 32)));
|
|
364
387
|
objMap[symId] = obj;
|
|
365
388
|
return obj;
|
|
366
389
|
}
|
|
@@ -374,27 +397,34 @@ const MemObj* SymbolTableInfo::createDummyObj(SymID symId, const Type* type)
|
|
|
374
397
|
}
|
|
375
398
|
|
|
376
399
|
/// Number of flattenned elements of an array or struct
|
|
377
|
-
|
|
400
|
+
u32_t SymbolTableInfo::getNumOfFlattenElements(const Type *T)
|
|
378
401
|
{
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
const u32_t SymbolTableInfo::getNumOfFlattenFields(const StructType *T)
|
|
384
|
-
{
|
|
385
|
-
return getStructInfoIter(T)->second->getNumOfFlattenFields();
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
/// Flatterned full offset information of a struct including its array fields
|
|
389
|
-
const std::vector<u32_t>& SymbolTableInfo::getFlattenedElemIdxVec(const Type *T)
|
|
390
|
-
{
|
|
391
|
-
return getStructInfoIter(T)->second->getFlattenedElemIdxVec();
|
|
402
|
+
if(Options::ModelArrays)
|
|
403
|
+
return getStructInfoIter(T)->second->getNumOfFlattenElements();
|
|
404
|
+
else
|
|
405
|
+
return getStructInfoIter(T)->second->getNumOfFlattenFields();
|
|
392
406
|
}
|
|
393
407
|
|
|
394
|
-
/// Flatterned
|
|
395
|
-
|
|
408
|
+
/// Flatterned offset information of a struct or an array including its array fields
|
|
409
|
+
u32_t SymbolTableInfo::getFlattenedElemIdx(const Type *T, s64_t origId)
|
|
396
410
|
{
|
|
397
|
-
|
|
411
|
+
if(Options::ModelArrays){
|
|
412
|
+
std::vector<u32_t>& so = getStructInfoIter(T)->second->getFlattenedElemIdxVec();
|
|
413
|
+
assert ((unsigned)origId <= so.size() && !so.empty() && "Array index out of bounds, can't get flattened index!");
|
|
414
|
+
return so[origId];
|
|
415
|
+
}
|
|
416
|
+
else{
|
|
417
|
+
if(SVFUtil::isa<StructType>(T)){
|
|
418
|
+
std::vector<u32_t>& so = getStructInfoIter(T)->second->getFlattenedFieldIdxVec();
|
|
419
|
+
assert ((unsigned)origId <= so.size() && !so.empty() && "Struct index out of bounds, can't get flattened index!");
|
|
420
|
+
return so[origId];
|
|
421
|
+
}
|
|
422
|
+
else{
|
|
423
|
+
/// When Options::ModelArrays is disabled, any element index Array is modeled as the base
|
|
424
|
+
assert(SVFUtil::isa<ArrayType>(T) && "Only accept struct or array type if Options::ModelArrays is disabled!");
|
|
425
|
+
return 0;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
398
428
|
}
|
|
399
429
|
|
|
400
430
|
const std::vector<FlattenedFieldInfo>& SymbolTableInfo::getFlattenedFieldInfoVec(const Type *T)
|
|
@@ -579,36 +609,13 @@ u32_t SymbolTableInfo::getTypeSizeInBytes(const StructType *sty, u32_t field_idx
|
|
|
579
609
|
}
|
|
580
610
|
|
|
581
611
|
|
|
582
|
-
|
|
583
|
-
/*!
|
|
584
|
-
* Analyse types of heap and static objects
|
|
585
|
-
*/
|
|
586
|
-
void ObjTypeInfo::analyzeHeapObjType(const Type*)
|
|
587
|
-
{
|
|
588
|
-
// TODO: Heap and static objects are considered as pointers right now.
|
|
589
|
-
// Refine this function to get more details about heap and static objects.
|
|
590
|
-
setFlag(HEAP_OBJ);
|
|
591
|
-
setFlag(HASPTR_OBJ);
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
/*!
|
|
595
|
-
* Analyse types of heap and static objects
|
|
596
|
-
*/
|
|
597
|
-
void ObjTypeInfo::analyzeStaticObjType(const Type*)
|
|
598
|
-
{
|
|
599
|
-
// TODO: Heap and static objects are considered as pointers right now.
|
|
600
|
-
// Refine this function to get more details about heap and static objects.
|
|
601
|
-
setFlag(STATIC_OBJ);
|
|
602
|
-
setFlag(HASPTR_OBJ);
|
|
603
|
-
}
|
|
604
|
-
|
|
605
612
|
/*!
|
|
606
613
|
* Whether a location set is a pointer type or not
|
|
607
614
|
*/
|
|
608
615
|
bool ObjTypeInfo::isNonPtrFieldObj(const LocationSet& ls)
|
|
609
616
|
{
|
|
610
|
-
if (
|
|
611
|
-
return
|
|
617
|
+
if (hasPtrObj() == false)
|
|
618
|
+
return true;
|
|
612
619
|
|
|
613
620
|
const Type* ety = getType();
|
|
614
621
|
while (const ArrayType *AT= SVFUtil::dyn_cast<ArrayType>(ety))
|
|
@@ -625,7 +632,7 @@ bool ObjTypeInfo::isNonPtrFieldObj(const LocationSet& ls)
|
|
|
625
632
|
for (; it != eit; ++it)
|
|
626
633
|
{
|
|
627
634
|
const FlattenedFieldInfo& fieldLS = *it;
|
|
628
|
-
if (ls.intersects(LocationSet(fieldLS)))
|
|
635
|
+
if (ls.intersects(LocationSet(fieldLS.getFlattenFldIdx())))
|
|
629
636
|
{
|
|
630
637
|
hasIntersection = true;
|
|
631
638
|
if (fieldLS.getFlattenElemTy()->isPointerTy())
|
|
@@ -637,28 +644,10 @@ bool ObjTypeInfo::isNonPtrFieldObj(const LocationSet& ls)
|
|
|
637
644
|
}
|
|
638
645
|
else
|
|
639
646
|
{
|
|
640
|
-
|
|
641
|
-
{
|
|
642
|
-
// TODO: Objects which cannot find proper field for a certain offset including
|
|
643
|
-
// arguments in main(), static objects allocated before main and heap
|
|
644
|
-
// objects. Right now they're considered to have infinite fields and we
|
|
645
|
-
// treat each field as pointers conservatively.
|
|
646
|
-
// Try to model static and heap objects more accurately in the future.
|
|
647
|
-
return false;
|
|
648
|
-
}
|
|
649
|
-
else
|
|
650
|
-
{
|
|
651
|
-
// TODO: Using new memory model (locMM) may create objects with spurious offset
|
|
652
|
-
// as we simply return new offset by mod operation without checking its
|
|
653
|
-
// correctness in LocSymTableInfo::getModulusOffset(). So the following
|
|
654
|
-
// assertion may fail. Try to refine the new memory model.
|
|
655
|
-
//assert(ls.getConstantFieldIdx() == 0 && "cannot get a field from a non-struct type");
|
|
656
|
-
return (hasPtrObj() == false);
|
|
657
|
-
}
|
|
647
|
+
return (hasPtrObj() == false);
|
|
658
648
|
}
|
|
659
649
|
}
|
|
660
650
|
|
|
661
|
-
|
|
662
651
|
/*!
|
|
663
652
|
* Set mem object to be field sensitive (up to maximum field limit)
|
|
664
653
|
*/
|
package/lib/SVF-FE/LLVMUtil.cpp
CHANGED
|
@@ -188,15 +188,15 @@ const Value * SVFUtil::stripConstantCasts(const Value *val)
|
|
|
188
188
|
/*!
|
|
189
189
|
* Strip all casts
|
|
190
190
|
*/
|
|
191
|
-
Value * SVFUtil::stripAllCasts(Value *val)
|
|
191
|
+
const Value * SVFUtil::stripAllCasts(const Value *val)
|
|
192
192
|
{
|
|
193
193
|
while (true)
|
|
194
194
|
{
|
|
195
|
-
if (CastInst *ci = SVFUtil::dyn_cast<CastInst>(val))
|
|
195
|
+
if (const CastInst *ci = SVFUtil::dyn_cast<CastInst>(val))
|
|
196
196
|
{
|
|
197
197
|
val = ci->getOperand(0);
|
|
198
198
|
}
|
|
199
|
-
else if (ConstantExpr *ce = SVFUtil::dyn_cast<ConstantExpr>(val))
|
|
199
|
+
else if (const ConstantExpr *ce = SVFUtil::dyn_cast<ConstantExpr>(val))
|
|
200
200
|
{
|
|
201
201
|
if(ce->isCast())
|
|
202
202
|
val = ce->getOperand(0);
|