svf-tools 1.0.327 → 1.0.331
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/SVF-doxygen/html/html/AndersenHCD_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/AndersenSCD_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/AndersenSFR_8cpp_source.html +7 -7
- package/SVF-doxygen/html/html/AndersenSFR_8h_source.html +4 -4
- package/SVF-doxygen/html/html/AndersenWaveDiff_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/Andersen_8cpp_source.html +38 -38
- package/SVF-doxygen/html/html/Andersen_8h_source.html +6 -6
- package/SVF-doxygen/html/html/CSC_8cpp_source.html +2 -3
- package/SVF-doxygen/html/html/ConsGEdge_8h_source.html +3 -3
- package/SVF-doxygen/html/html/ConsGNode_8h_source.html +5 -5
- package/SVF-doxygen/html/html/ConsG_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/ConsG_8h_source.html +4 -4
- package/SVF-doxygen/html/html/ContextDDA_8cpp_source.html +6 -6
- package/SVF-doxygen/html/html/ContextDDA_8h_source.html +1 -1
- package/SVF-doxygen/html/html/DDAClient_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/DDAStat_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/DDAVFSolver_8h_source.html +6 -6
- package/SVF-doxygen/html/html/FSMPTA_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/FlowDDA_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/FlowDDA_8h_source.html +2 -2
- package/SVF-doxygen/html/html/FlowSensitiveStat_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/FlowSensitiveTBHC_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/FlowSensitive_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/IRAnnotator_8h_source.html +6 -7
- package/SVF-doxygen/html/html/IRGraph_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/IRGraph_8h_source.html +1 -1
- package/SVF-doxygen/html/html/LocationSet_8cpp.html +1 -0
- package/SVF-doxygen/html/html/LocationSet_8cpp_source.html +12 -15
- package/SVF-doxygen/html/html/LocationSet_8h.html +1 -1
- package/SVF-doxygen/html/html/LocationSet_8h_source.html +26 -40
- package/SVF-doxygen/html/html/MemRegion_8cpp_source.html +5 -5
- package/SVF-doxygen/html/html/OfflineConsG_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/PAGBuilderFromFile_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/PTAStat_8cpp_source.html +15 -15
- package/SVF-doxygen/html/html/PointerAnalysisImpl_8cpp_source.html +10 -10
- package/SVF-doxygen/html/html/PointerAnalysisImpl_8h_source.html +2 -2
- package/SVF-doxygen/html/html/PointerAnalysis_8cpp_source.html +28 -29
- package/SVF-doxygen/html/html/PointerAnalysis_8h_source.html +29 -29
- package/SVF-doxygen/html/html/SVFIRBuilder_8cpp_source.html +11 -3
- package/SVF-doxygen/html/html/SVFIRBuilder_8h_source.html +71 -70
- package/SVF-doxygen/html/html/SVFIR_8cpp_source.html +12 -12
- package/SVF-doxygen/html/html/SVFIR_8h_source.html +13 -13
- package/SVF-doxygen/html/html/SVFStatements_8h_source.html +3 -3
- package/SVF-doxygen/html/html/SVFVariables_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/SVFVariables_8h.html +1 -1
- package/SVF-doxygen/html/html/SVFVariables_8h_source.html +69 -69
- package/SVF-doxygen/html/html/SaberSVFGBuilder_8cpp_source.html +4 -4
- package/SVF-doxygen/html/html/Steensgaard_8h_source.html +1 -1
- package/SVF-doxygen/html/html/SymbolTableBuilder_8cpp_source.html +21 -21
- package/SVF-doxygen/html/html/SymbolTableBuilder_8h_source.html +1 -1
- package/SVF-doxygen/html/html/SymbolTableInfo_8cpp_source.html +52 -63
- package/SVF-doxygen/html/html/SymbolTableInfo_8h_source.html +72 -79
- package/SVF-doxygen/html/html/ThreadCallGraph_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/TypeAnalysis_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/TypeBasedHeapCloning_8cpp_source.html +13 -13
- package/SVF-doxygen/html/html/TypeBasedHeapCloning_8h_source.html +2 -2
- package/SVF-doxygen/html/html/VersionedFlowSensitiveStat_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/annotated.html +6 -6
- package/SVF-doxygen/html/html/classSVF_1_1Andersen-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1Andersen.html +79 -79
- package/SVF-doxygen/html/html/classSVF_1_1AndersenBase-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenBase.html +23 -24
- package/SVF-doxygen/html/html/classSVF_1_1AndersenHCD-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenHCD.html +9 -9
- package/SVF-doxygen/html/html/classSVF_1_1AndersenHLCD-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenHLCD.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1AndersenLCD-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenLCD.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1AndersenSCD-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenSCD.html +13 -13
- package/SVF-doxygen/html/html/classSVF_1_1AndersenSFR-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenSFR.html +13 -13
- package/SVF-doxygen/html/html/classSVF_1_1AndersenWaveDiff-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenWaveDiff.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1BVDataPTAImpl-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1BVDataPTAImpl.html +17 -17
- package/SVF-doxygen/html/html/classSVF_1_1CSC.html +2 -3
- package/SVF-doxygen/html/html/classSVF_1_1CloneDummyObjVar.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1CloneFIObjVar.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1CloneGepObjVar-members.html +56 -55
- package/SVF-doxygen/html/html/classSVF_1_1CloneGepObjVar.html +44 -41
- package/SVF-doxygen/html/html/classSVF_1_1CloneGepObjVar.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1CondPTAImpl-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1CondPTAImpl.html +7 -7
- package/SVF-doxygen/html/html/classSVF_1_1ConstraintGraph.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1ConstraintNode-members.html +26 -26
- package/SVF-doxygen/html/html/classSVF_1_1ConstraintNode.html +43 -43
- package/SVF-doxygen/html/html/classSVF_1_1ContextDDA-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1ContextDDA.html +9 -9
- package/SVF-doxygen/html/html/classSVF_1_1DDAPass.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1DDAStat.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1DDAVFSolver.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1DummyObjVar.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1DummyValVar.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1FIObjVar.html +13 -13
- package/SVF-doxygen/html/html/classSVF_1_1FSMPTA-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FSMPTA.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1FlattenedFieldInfo-members.html +85 -0
- package/SVF-doxygen/html/html/classSVF_1_1FlattenedFieldInfo.html +254 -0
- package/SVF-doxygen/html/html/classSVF_1_1FlowDDA-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FlowDDA.html +7 -7
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitive-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitive.html +9 -9
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveStat.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveTBHC-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveTBHC.html +10 -10
- package/SVF-doxygen/html/html/classSVF_1_1FunptrDDAClient.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1GenericNode.html +22 -23
- package/SVF-doxygen/html/html/classSVF_1_1GenericNode.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1GepObjPN.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1GepObjVar-members.html +173 -0
- package/SVF-doxygen/html/html/classSVF_1_1GepObjVar.html +813 -0
- package/SVF-doxygen/html/html/classSVF_1_1GepObjVar.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1GepValVar.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1IRAnnotator-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1IRAnnotator.html +8 -8
- package/SVF-doxygen/html/html/classSVF_1_1LocationSet-members.html +17 -21
- package/SVF-doxygen/html/html/classSVF_1_1LocationSet.html +150 -326
- package/SVF-doxygen/html/html/classSVF_1_1MRGenerator.html +6 -6
- package/SVF-doxygen/html/html/classSVF_1_1MemObj.html +84 -84
- package/SVF-doxygen/html/html/classSVF_1_1NormalGepCGEdge.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1NormalGepStmt.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1ObjTypeInfo.html +96 -96
- package/SVF-doxygen/html/html/classSVF_1_1ObjVar.html +5 -5
- package/SVF-doxygen/html/html/classSVF_1_1ObjVar.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1PAGBuilderFromFile.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1PTAStat.html +15 -15
- package/SVF-doxygen/html/html/classSVF_1_1PointerAnalysis-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1PointerAnalysis.html +75 -73
- package/SVF-doxygen/html/html/classSVF_1_1RetPN.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1SVFIR-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1SVFIR.html +31 -31
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder-members.html +57 -56
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +301 -229
- package/SVF-doxygen/html/html/classSVF_1_1SVFVar.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1SVFVar.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1SaberSVFGBuilder.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1StInfo-members.html +11 -14
- package/SVF-doxygen/html/html/classSVF_1_1StInfo.html +70 -168
- package/SVF-doxygen/html/html/classSVF_1_1Steensgaard-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1Steensgaard.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableBuilder.html +30 -30
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo-members.html +20 -24
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo.html +110 -291
- package/SVF-doxygen/html/html/classSVF_1_1ThreadCallGraph.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1TypeAnalysis-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1TypeAnalysis.html +9 -9
- package/SVF-doxygen/html/html/classSVF_1_1TypeBasedHeapCloning.html +18 -18
- package/SVF-doxygen/html/html/classSVF_1_1VarArgPN.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitive-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitive.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitiveStat.html +3 -3
- package/SVF-doxygen/html/html/classes.html +6 -6
- package/SVF-doxygen/html/html/functions_a.html +13 -10
- package/SVF-doxygen/html/html/functions_b.html +1 -5
- package/SVF-doxygen/html/html/functions_c.html +19 -20
- package/SVF-doxygen/html/html/functions_d.html +1 -1
- package/SVF-doxygen/html/html/functions_e.html +0 -16
- package/SVF-doxygen/html/html/functions_f.html +21 -19
- package/SVF-doxygen/html/html/functions_func.html +15 -12
- package/SVF-doxygen/html/html/functions_func_c.html +16 -17
- package/SVF-doxygen/html/html/functions_func_d.html +1 -1
- package/SVF-doxygen/html/html/functions_func_e.html +2 -8
- package/SVF-doxygen/html/html/functions_func_f.html +4 -4
- package/SVF-doxygen/html/html/functions_func_g.html +36 -58
- package/SVF-doxygen/html/html/functions_func_i.html +11 -14
- package/SVF-doxygen/html/html/functions_func_r.html +3 -3
- package/SVF-doxygen/html/html/functions_func_s.html +6 -9
- package/SVF-doxygen/html/html/functions_func_t.html +1 -1
- package/SVF-doxygen/html/html/functions_func_w.html +1 -1
- package/SVF-doxygen/html/html/functions_g.html +41 -63
- package/SVF-doxygen/html/html/functions_i.html +6 -9
- package/SVF-doxygen/html/html/functions_l.html +4 -4
- package/SVF-doxygen/html/html/functions_n.html +4 -7
- package/SVF-doxygen/html/html/functions_o.html +25 -20
- package/SVF-doxygen/html/html/functions_p.html +12 -16
- package/SVF-doxygen/html/html/functions_r.html +4 -4
- package/SVF-doxygen/html/html/functions_s.html +15 -18
- package/SVF-doxygen/html/html/functions_t.html +1 -1
- package/SVF-doxygen/html/html/functions_type_e.html +0 -4
- package/SVF-doxygen/html/html/functions_type_o.html +3 -0
- package/SVF-doxygen/html/html/functions_v.html +3 -3
- package/SVF-doxygen/html/html/functions_vars_b.html +1 -5
- package/SVF-doxygen/html/html/functions_vars_c.html +1 -1
- package/SVF-doxygen/html/html/functions_vars_e.html +0 -6
- package/SVF-doxygen/html/html/functions_vars_f.html +9 -7
- package/SVF-doxygen/html/html/functions_vars_l.html +1 -1
- package/SVF-doxygen/html/html/functions_vars_n.html +0 -3
- package/SVF-doxygen/html/html/functions_vars_o.html +2 -2
- package/SVF-doxygen/html/html/functions_w.html +1 -1
- package/SVF-doxygen/html/html/hierarchy.html +64 -64
- package/SVF-doxygen/html/html/namespaceSVF.html +3 -3
- package/SVF-doxygen/html/html/search/all_1.js +3 -2
- package/SVF-doxygen/html/html/search/all_10.js +6 -6
- package/SVF-doxygen/html/html/search/all_12.js +3 -3
- package/SVF-doxygen/html/html/search/all_13.js +5 -6
- package/SVF-doxygen/html/html/search/all_14.js +6 -6
- package/SVF-doxygen/html/html/search/all_16.js +2 -2
- package/SVF-doxygen/html/html/search/all_17.js +1 -1
- package/SVF-doxygen/html/html/search/all_2.js +2 -3
- package/SVF-doxygen/html/html/search/all_3.js +5 -5
- package/SVF-doxygen/html/html/search/all_4.js +1 -1
- package/SVF-doxygen/html/html/search/all_5.js +0 -5
- package/SVF-doxygen/html/html/search/all_6.js +6 -5
- package/SVF-doxygen/html/html/search/all_7.js +15 -23
- package/SVF-doxygen/html/html/search/all_9.js +2 -3
- package/SVF-doxygen/html/html/search/all_c.js +4 -4
- package/SVF-doxygen/html/html/search/all_e.js +1 -2
- package/SVF-doxygen/html/html/search/all_f.js +5 -4
- package/SVF-doxygen/html/html/search/classes_5.js +1 -1
- package/SVF-doxygen/html/html/search/classes_6.js +1 -1
- package/SVF-doxygen/html/html/search/functions_0.js +3 -2
- package/SVF-doxygen/html/html/search/functions_10.js +2 -3
- package/SVF-doxygen/html/html/search/functions_11.js +1 -1
- package/SVF-doxygen/html/html/search/functions_14.js +1 -1
- package/SVF-doxygen/html/html/search/functions_2.js +3 -3
- package/SVF-doxygen/html/html/search/functions_3.js +1 -1
- package/SVF-doxygen/html/html/search/functions_4.js +0 -2
- package/SVF-doxygen/html/html/search/functions_5.js +1 -1
- package/SVF-doxygen/html/html/search/functions_6.js +15 -23
- package/SVF-doxygen/html/html/search/functions_8.js +1 -2
- package/SVF-doxygen/html/html/search/functions_a.js +1 -1
- package/SVF-doxygen/html/html/search/functions_e.js +1 -1
- package/SVF-doxygen/html/html/search/functions_f.js +1 -1
- package/SVF-doxygen/html/html/search/typedefs_4.js +0 -1
- package/SVF-doxygen/html/html/search/typedefs_e.js +1 -0
- package/SVF-doxygen/html/html/search/variables_14.js +3 -3
- package/SVF-doxygen/html/html/search/variables_2.js +2 -3
- package/SVF-doxygen/html/html/search/variables_3.js +1 -1
- package/SVF-doxygen/html/html/search/variables_5.js +0 -2
- package/SVF-doxygen/html/html/search/variables_6.js +5 -4
- package/SVF-doxygen/html/html/search/variables_c.js +1 -1
- package/SVF-doxygen/html/html/search/variables_e.js +0 -1
- package/SVF-doxygen/html/html/search/variables_f.js +1 -1
- 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_01IRGraph_01_5_01_4.html +1 -1
- 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 +5 -5
- package/SVF-doxygen/html/html/svf-ex_8cpp.html +1 -1
- package/SVF-doxygen/html/html/svf-ex_8cpp_source.html +1 -1
- package/include/Graphs/ConsG.h +1 -1
- package/include/Graphs/ConsGEdge.h +1 -1
- package/include/MemoryModel/LocationSet.h +39 -126
- package/include/MemoryModel/PointerAnalysis.h +1 -1
- package/include/MemoryModel/SVFIR.h +2 -2
- package/include/MemoryModel/SVFStatements.h +1 -1
- package/include/MemoryModel/SVFVariables.h +17 -11
- package/include/MemoryModel/SymbolTableInfo.h +27 -31
- package/include/SVF-FE/SVFIRBuilder.h +6 -1
- package/include/Util/IRAnnotator.h +3 -3
- package/lib/DDA/ContextDDA.cpp +1 -1
- package/lib/Graphs/ConsG.cpp +1 -1
- package/lib/Graphs/IRGraph.cpp +1 -1
- package/lib/Graphs/OfflineConsG.cpp +1 -1
- package/lib/MemoryModel/LocationSet.cpp +53 -95
- package/lib/MemoryModel/PointerAnalysis.cpp +4 -2
- package/lib/MemoryModel/PointerAnalysisImpl.cpp +4 -4
- package/lib/MemoryModel/SVFIR.cpp +4 -4
- package/lib/MemoryModel/SVFVariables.cpp +2 -2
- package/lib/MemoryModel/SymbolTableInfo.cpp +44 -212
- package/lib/SABER/SaberSVFGBuilder.cpp +1 -1
- package/lib/SVF-FE/SVFIRBuilder.cpp +135 -7
- package/lib/SVF-FE/SymbolTableBuilder.cpp +4 -4
- package/lib/Util/TypeBasedHeapCloning.cpp +10 -10
- package/lib/WPA/Andersen.cpp +1 -5
- package/lib/WPA/AndersenSFR.cpp +2 -2
- package/lib/WPA/CSC.cpp +1 -1
- package/lib/WPA/FlowSensitiveTBHC.cpp +6 -6
- package/package.json +1 -1
- package/tools/Example/svf-ex.cpp +1 -2
|
@@ -419,7 +419,7 @@ public:
|
|
|
419
419
|
/// offset of the base value variable
|
|
420
420
|
inline u32_t getOffset() const
|
|
421
421
|
{
|
|
422
|
-
return ls.
|
|
422
|
+
return ls.accumulateConstantOffset();
|
|
423
423
|
}
|
|
424
424
|
|
|
425
425
|
/// Return name of a LLVM value
|
|
@@ -448,7 +448,7 @@ public:
|
|
|
448
448
|
* Gep Obj variable, this is dynamic generated for field sensitive analysis
|
|
449
449
|
* Each gep obj variable is one field of a MemObj (base)
|
|
450
450
|
*/
|
|
451
|
-
class
|
|
451
|
+
class GepObjVar: public ObjVar
|
|
452
452
|
{
|
|
453
453
|
private:
|
|
454
454
|
LocationSet ls;
|
|
@@ -457,7 +457,7 @@ private:
|
|
|
457
457
|
public:
|
|
458
458
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
459
459
|
//@{
|
|
460
|
-
static inline bool classof(const
|
|
460
|
+
static inline bool classof(const GepObjVar *)
|
|
461
461
|
{
|
|
462
462
|
return true;
|
|
463
463
|
}
|
|
@@ -479,7 +479,7 @@ public:
|
|
|
479
479
|
//@}
|
|
480
480
|
|
|
481
481
|
/// Constructor
|
|
482
|
-
|
|
482
|
+
GepObjVar(const MemObj* mem, NodeID i, const LocationSet& l, PNODEK ty = GepObjNode) :
|
|
483
483
|
ObjVar(mem->getValue(), i, mem, ty), ls(l)
|
|
484
484
|
{
|
|
485
485
|
base = mem->getId();
|
|
@@ -491,6 +491,12 @@ public:
|
|
|
491
491
|
return ls;
|
|
492
492
|
}
|
|
493
493
|
|
|
494
|
+
/// offset of the mem object
|
|
495
|
+
inline u32_t getOffset() const
|
|
496
|
+
{
|
|
497
|
+
return ls.accumulateConstantOffset();
|
|
498
|
+
}
|
|
499
|
+
|
|
494
500
|
/// Set the base object from which this GEP node came from.
|
|
495
501
|
inline void setBaseNode(NodeID base)
|
|
496
502
|
{
|
|
@@ -504,17 +510,17 @@ public:
|
|
|
504
510
|
}
|
|
505
511
|
|
|
506
512
|
/// Return the type of this gep object
|
|
507
|
-
inline virtual const
|
|
513
|
+
inline virtual const Type* getType() const
|
|
508
514
|
{
|
|
509
|
-
return SymbolTableInfo::SymbolInfo()->
|
|
515
|
+
return SymbolTableInfo::SymbolInfo()->getOriginalFieldType(mem->getType(), ls.accumulateConstantOffset());
|
|
510
516
|
}
|
|
511
517
|
|
|
512
518
|
/// Return name of a LLVM value
|
|
513
519
|
inline const std::string getValueName() const
|
|
514
520
|
{
|
|
515
521
|
if (value && value->hasName())
|
|
516
|
-
return value->getName().str() + "_" + llvm::itostr(ls.
|
|
517
|
-
return "offset_" + llvm::itostr(ls.
|
|
522
|
+
return value->getName().str() + "_" + llvm::itostr(ls.accumulateConstantOffset());
|
|
523
|
+
return "offset_" + llvm::itostr(ls.accumulateConstantOffset());
|
|
518
524
|
}
|
|
519
525
|
|
|
520
526
|
virtual const std::string toString() const;
|
|
@@ -766,7 +772,7 @@ public:
|
|
|
766
772
|
/*
|
|
767
773
|
* Clone object for GEP objects.
|
|
768
774
|
*/
|
|
769
|
-
class CloneGepObjVar : public
|
|
775
|
+
class CloneGepObjVar : public GepObjVar
|
|
770
776
|
{
|
|
771
777
|
public:
|
|
772
778
|
//@{ Methods to support type inquiry through isa, cast, and dyn_cast:
|
|
@@ -786,14 +792,14 @@ public:
|
|
|
786
792
|
|
|
787
793
|
/// Constructor
|
|
788
794
|
CloneGepObjVar(const MemObj* mem, NodeID i, const LocationSet& l, PNODEK ty = CloneGepObjNode) :
|
|
789
|
-
|
|
795
|
+
GepObjVar(mem, i, l, ty)
|
|
790
796
|
{
|
|
791
797
|
}
|
|
792
798
|
|
|
793
799
|
/// Return name of this node
|
|
794
800
|
inline const std::string getValueName() const
|
|
795
801
|
{
|
|
796
|
-
return "clone (gep) of " +
|
|
802
|
+
return "clone (gep) of " + GepObjVar::getValueName();
|
|
797
803
|
}
|
|
798
804
|
|
|
799
805
|
virtual const std::string toString() const;
|
|
@@ -364,19 +364,16 @@ public:
|
|
|
364
364
|
}
|
|
365
365
|
|
|
366
366
|
///Get a reference to the components of struct_info.
|
|
367
|
-
const std::vector<u32_t>&
|
|
368
|
-
const std::vector<
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
367
|
+
const std::vector<u32_t>& getFlattenedFieldIdxVec(const Type *T);
|
|
368
|
+
const std::vector<FlattenedFieldInfo>& getFlattenedFieldInfoVec(const Type *T);
|
|
369
|
+
|
|
370
|
+
/// struct A { int id; int salary; }; struct B { char name[20]; struct A a;} B b;
|
|
371
|
+
/// OriginalFieldType of b with field_idx 1 : Struct A
|
|
372
|
+
/// FlatternedFieldType of b with field_idx 1 : int
|
|
373
|
+
const Type* getOriginalFieldType(const Type* baseType, u32_t field_idx);
|
|
374
|
+
const Type* getFlatternedFieldType(const Type* baseType, u32_t field_idx);
|
|
372
375
|
//@}
|
|
373
376
|
|
|
374
|
-
/// Compute gep offset
|
|
375
|
-
virtual bool computeGepOffset(const User *V, LocationSet& ls);
|
|
376
|
-
/// Get the base type and max offset
|
|
377
|
-
const Type *getBaseTypeAndFlattenedFields(const Value *V, std::vector<LocationSet> &fields);
|
|
378
|
-
/// Replace fields with flatten fields of T if the number of its fields is larger than msz.
|
|
379
|
-
u32_t getFields(std::vector<LocationSet>& fields, const Type* T, u32_t msz);
|
|
380
377
|
/// Collect type info
|
|
381
378
|
void collectTypeInfo(const Type* T);
|
|
382
379
|
/// Given an offset from a Gep Instruction, return it modulus offset by considering memory layout
|
|
@@ -511,14 +508,10 @@ class StInfo
|
|
|
511
508
|
private:
|
|
512
509
|
/// flattened field indices of a struct
|
|
513
510
|
std::vector<u32_t> fldIdxVec;
|
|
514
|
-
/// flattened field offsets of of a struct
|
|
515
|
-
std::vector<u32_t> foffset;
|
|
516
511
|
/// Types of all fields of a struct
|
|
517
|
-
Map<u32_t, const
|
|
518
|
-
/// Types of all fields of a struct
|
|
519
|
-
Map<u32_t, const llvm::Type*> offset2TypeMap;
|
|
512
|
+
Map<u32_t, const Type*> fldIdx2TypeMap;
|
|
520
513
|
/// All field infos after flattening a struct
|
|
521
|
-
std::vector<
|
|
514
|
+
std::vector<FlattenedFieldInfo> finfo;
|
|
522
515
|
|
|
523
516
|
/// Max field limit
|
|
524
517
|
static u32_t maxFieldLimit;
|
|
@@ -543,37 +536,40 @@ public:
|
|
|
543
536
|
return maxFieldLimit;
|
|
544
537
|
}
|
|
545
538
|
|
|
546
|
-
///
|
|
539
|
+
/// struct A { int id; int salary; }; struct B { char name[20]; struct A a;} B b;
|
|
540
|
+
/// OriginalFieldType of b with field_idx 1 : Struct A
|
|
541
|
+
/// FlatternedFieldType of b with field_idx 1 : int
|
|
547
542
|
//{@
|
|
548
|
-
inline const
|
|
543
|
+
inline const Type* getOriginalFieldType(u32_t fldIdx)
|
|
549
544
|
{
|
|
550
|
-
|
|
545
|
+
Map<u32_t, const Type*>::const_iterator it = fldIdx2TypeMap.find(fldIdx);
|
|
546
|
+
if(it!=fldIdx2TypeMap.end())
|
|
547
|
+
return it->second;
|
|
548
|
+
return nullptr;
|
|
551
549
|
}
|
|
552
|
-
inline const
|
|
550
|
+
inline const Type* getFlatternedFieldType(u32_t fldIdx)
|
|
553
551
|
{
|
|
554
|
-
|
|
552
|
+
for(FlattenedFieldInfo& fallenedFld : finfo){
|
|
553
|
+
if(fallenedFld.getFlattenFldIdx() == fldIdx)
|
|
554
|
+
return fallenedFld.getFlattenElemTy();
|
|
555
|
+
}
|
|
556
|
+
return nullptr;
|
|
555
557
|
}
|
|
556
|
-
inline std::vector<u32_t>&
|
|
558
|
+
inline std::vector<u32_t>& getFlattenedFieldIdxVec()
|
|
557
559
|
{
|
|
558
560
|
return fldIdxVec;
|
|
559
561
|
}
|
|
560
|
-
inline std::vector<
|
|
561
|
-
{
|
|
562
|
-
return foffset;
|
|
563
|
-
}
|
|
564
|
-
inline std::vector<FieldInfo>& getFlattenFieldInfoVec()
|
|
562
|
+
inline std::vector<FlattenedFieldInfo>& getFlattenedFieldInfoVec()
|
|
565
563
|
{
|
|
566
564
|
return finfo;
|
|
567
565
|
}
|
|
568
566
|
//@}
|
|
569
567
|
|
|
570
568
|
/// Add field (index and offset) with its corresponding type
|
|
571
|
-
inline void addFldWithType(u32_t fldIdx,
|
|
569
|
+
inline void addFldWithType(u32_t fldIdx, const Type* type)
|
|
572
570
|
{
|
|
573
571
|
fldIdxVec.push_back(fldIdx);
|
|
574
|
-
foffset.push_back(offset);
|
|
575
572
|
fldIdx2TypeMap[fldIdx] = type;
|
|
576
|
-
offset2TypeMap[offset] = type;
|
|
577
573
|
}
|
|
578
574
|
};
|
|
579
575
|
|
|
@@ -124,6 +124,12 @@ public:
|
|
|
124
124
|
/// Compute offset of a gep instruction or gep constant expression
|
|
125
125
|
bool computeGepOffset(const User *V, LocationSet& ls);
|
|
126
126
|
|
|
127
|
+
/// Get the base type and max offset
|
|
128
|
+
const Type *getBaseTypeAndFlattenedFields(const Value *V, std::vector<LocationSet> &fields);
|
|
129
|
+
|
|
130
|
+
/// Replace fields with flatten fields of T if the number of its fields is larger than msz.
|
|
131
|
+
u32_t getFields(std::vector<LocationSet>& fields, const Type* T, u32_t msz);
|
|
132
|
+
|
|
127
133
|
/// Handle direct call
|
|
128
134
|
void handleDirectCall(CallSite cs, const SVFFunction *F);
|
|
129
135
|
|
|
@@ -133,7 +139,6 @@ public:
|
|
|
133
139
|
/// Handle external call
|
|
134
140
|
//@{
|
|
135
141
|
virtual void handleExtCall(CallSite cs, const SVFFunction *F);
|
|
136
|
-
const Type *getBaseTypeAndFlattenedFields(Value* v, std::vector<LocationSet> &fields);
|
|
137
142
|
void addComplexConsForExt(Value *D, Value *S,u32_t sz = 0);
|
|
138
143
|
//@}
|
|
139
144
|
|
|
@@ -42,7 +42,7 @@ public:
|
|
|
42
42
|
{
|
|
43
43
|
auto nodeId = it->first;
|
|
44
44
|
auto pagNode = it->second;
|
|
45
|
-
auto gepNode = SVFUtil::dyn_cast<
|
|
45
|
+
auto gepNode = SVFUtil::dyn_cast<GepObjVar>(pagNode);
|
|
46
46
|
|
|
47
47
|
if (gepNode && writeFlag)
|
|
48
48
|
{
|
|
@@ -61,10 +61,10 @@ public:
|
|
|
61
61
|
private:
|
|
62
62
|
// Write the PAGgepNode to the IR such that metadata name is the SVFIR node id and the operands
|
|
63
63
|
// are its base node's id and location offset
|
|
64
|
-
void writePAGgepNode(SVF::NodeID nodeId,
|
|
64
|
+
void writePAGgepNode(SVF::NodeID nodeId, GepObjVar* gepNode)
|
|
65
65
|
{
|
|
66
66
|
auto baseNodeId = gepNode->getBaseNode();
|
|
67
|
-
auto locationSetOffset = gepNode->
|
|
67
|
+
auto locationSetOffset = gepNode->getOffset();
|
|
68
68
|
|
|
69
69
|
LLVMContext &context = mainModule->getContext();
|
|
70
70
|
llvm::SmallVector<llvm::Metadata *, 32> operands;
|
package/lib/DDA/ContextDDA.cpp
CHANGED
|
@@ -318,7 +318,7 @@ bool ContextDDA::isHeapCondMemObj(const CxtVar& var, const StoreSVFGNode*)
|
|
|
318
318
|
{
|
|
319
319
|
if (!mem->getValue()) {
|
|
320
320
|
PAGNode *pnode = _pag->getGNode(getPtrNodeID(var));
|
|
321
|
-
if(
|
|
321
|
+
if(GepObjVar* gepobj = SVFUtil::dyn_cast<GepObjVar>(pnode)){
|
|
322
322
|
assert(SVFUtil::isa<DummyObjVar>(_pag->getGNode(gepobj->getBaseNode())) && "emtpy refVal in a gep object whose base is a non-dummy object");
|
|
323
323
|
}
|
|
324
324
|
else{
|
package/lib/Graphs/ConsG.cpp
CHANGED
|
@@ -681,7 +681,7 @@ struct DOTGraphTraits<ConstraintGraph*> : public DOTGraphTraits<SVFIR*>
|
|
|
681
681
|
}
|
|
682
682
|
else if (SVFUtil::isa<ObjVar>(node))
|
|
683
683
|
{
|
|
684
|
-
if(SVFUtil::isa<
|
|
684
|
+
if(SVFUtil::isa<GepObjVar>(node))
|
|
685
685
|
return "shape=doubleoctagon";
|
|
686
686
|
else if(SVFUtil::isa<FIObjVar>(node))
|
|
687
687
|
return "shape=box3d";
|
package/lib/Graphs/IRGraph.cpp
CHANGED
|
@@ -174,7 +174,7 @@ struct DOTGraphTraits<IRGraph*> : public DefaultDOTGraphTraits
|
|
|
174
174
|
}
|
|
175
175
|
else if (SVFUtil::isa<ObjVar>(node))
|
|
176
176
|
{
|
|
177
|
-
if(SVFUtil::isa<
|
|
177
|
+
if(SVFUtil::isa<GepObjVar>(node))
|
|
178
178
|
return "shape=doubleoctagon";
|
|
179
179
|
else if(SVFUtil::isa<FIObjVar>(node))
|
|
180
180
|
return "shape=box3d";
|
|
@@ -254,7 +254,7 @@ struct DOTGraphTraits<OfflineConsG*> : public DOTGraphTraits<SVFIR*>
|
|
|
254
254
|
}
|
|
255
255
|
else if (SVFUtil::isa<ObjVar>(node))
|
|
256
256
|
{
|
|
257
|
-
if(SVFUtil::isa<
|
|
257
|
+
if(SVFUtil::isa<GepObjVar>(node))
|
|
258
258
|
return "shape=doubleoctagon";
|
|
259
259
|
else if(SVFUtil::isa<FIObjVar>(node))
|
|
260
260
|
return "shape=box3d";
|
|
@@ -31,122 +31,80 @@
|
|
|
31
31
|
|
|
32
32
|
#include "Util/Options.h"
|
|
33
33
|
#include "MemoryModel/LocationSet.h"
|
|
34
|
+
#include "Util/SVFUtil.h"
|
|
34
35
|
|
|
35
36
|
using namespace SVF;
|
|
36
|
-
|
|
37
|
+
using namespace SVFUtil;
|
|
37
38
|
|
|
38
39
|
/*!
|
|
39
|
-
* Add
|
|
40
|
+
* Add offset value to vector offsetValues
|
|
40
41
|
*/
|
|
41
|
-
|
|
42
|
+
bool LocationSet::addOffsetValue(const Value* offsetVal)
|
|
42
43
|
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return;
|
|
47
|
-
|
|
48
|
-
if (Options::SingleStride)
|
|
49
|
-
{
|
|
50
|
-
if (numStridePair.empty())
|
|
51
|
-
numStridePair.push_back(std::make_pair(StInfo::getMaxFieldLimit(),pair.second));
|
|
52
|
-
else
|
|
53
|
-
{
|
|
54
|
-
/// Find the GCD stride
|
|
55
|
-
NodeID existStride = (*numStridePair.begin()).second;
|
|
56
|
-
NodeID newStride = gcd(pair.second, existStride);
|
|
57
|
-
if (newStride != existStride)
|
|
58
|
-
{
|
|
59
|
-
numStridePair.pop_back();
|
|
60
|
-
numStridePair.push_back(std::make_pair(StInfo::getMaxFieldLimit(),newStride));
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
else
|
|
65
|
-
{
|
|
66
|
-
numStridePair.push_back(pair);
|
|
44
|
+
for(const Value* val : offsetValues){
|
|
45
|
+
if(val==offsetVal)
|
|
46
|
+
return false;
|
|
67
47
|
}
|
|
48
|
+
offsetValues.push_back(offsetVal);
|
|
49
|
+
return true;
|
|
68
50
|
}
|
|
69
51
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
* Return TRUE if it successfully increases any index by 1
|
|
73
|
-
*/
|
|
74
|
-
bool LocationSet::increaseIfNotReachUpperBound(std::vector<NodeID>& indices,
|
|
75
|
-
const ElemNumStridePairVec& pairVec) const
|
|
52
|
+
/// Return TRUE if all offset values are constants
|
|
53
|
+
bool LocationSet::isConstantOffset() const
|
|
76
54
|
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
bool reachUpperBound = true;
|
|
81
|
-
for (u32_t i = 0; i < indices.size(); i++)
|
|
82
|
-
{
|
|
83
|
-
assert(pairVec[i].first > 0 && "number must be greater than 0");
|
|
84
|
-
if (indices[i] < (pairVec[i].first - 1))
|
|
85
|
-
reachUpperBound = false;
|
|
55
|
+
for(const Value* val : offsetValues){
|
|
56
|
+
if(SVFUtil::isa<ConstantInt>(val) == false)
|
|
57
|
+
return false;
|
|
86
58
|
}
|
|
87
|
-
|
|
88
|
-
/// Increase index if not reach upper bound
|
|
89
|
-
bool increased = false;
|
|
90
|
-
if (reachUpperBound == false)
|
|
91
|
-
{
|
|
92
|
-
u32_t i = 0;
|
|
93
|
-
while (increased == false)
|
|
94
|
-
{
|
|
95
|
-
if (indices[i] < (pairVec[i].first - 1))
|
|
96
|
-
{
|
|
97
|
-
indices[i] += 1;
|
|
98
|
-
increased = true;
|
|
99
|
-
}
|
|
100
|
-
else
|
|
101
|
-
{
|
|
102
|
-
indices[i] = 0;
|
|
103
|
-
i++;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return increased;
|
|
59
|
+
return true;
|
|
109
60
|
}
|
|
110
61
|
|
|
111
|
-
|
|
112
62
|
/*!
|
|
113
63
|
* Compute all possible locations according to offset and number-stride pairs.
|
|
114
64
|
*/
|
|
115
65
|
NodeBS LocationSet::computeAllLocations() const
|
|
116
66
|
{
|
|
117
|
-
|
|
118
67
|
NodeBS result;
|
|
119
|
-
result.set(
|
|
68
|
+
result.set(accumulateConstantOffset());
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
120
71
|
|
|
121
|
-
|
|
72
|
+
SVF::LocationSet::LSRelation LocationSet::checkRelation(const LocationSet& LHS, const LocationSet& RHS)
|
|
73
|
+
{
|
|
74
|
+
NodeBS lhsLocations = LHS.computeAllLocations();
|
|
75
|
+
NodeBS rhsLocations = RHS.computeAllLocations();
|
|
76
|
+
if (lhsLocations.intersects(rhsLocations))
|
|
122
77
|
{
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
NodeID ofst = getOffset();
|
|
136
|
-
while (i < lhsVec.size())
|
|
137
|
-
{
|
|
138
|
-
ofst += (lhsVec[i].second * indices[i]);
|
|
139
|
-
i++;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
result.set(ofst);
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
while (increaseIfNotReachUpperBound(indices, lhsVec));
|
|
78
|
+
if (lhsLocations == rhsLocations)
|
|
79
|
+
return Same;
|
|
80
|
+
else if (lhsLocations.contains(rhsLocations))
|
|
81
|
+
return Superset;
|
|
82
|
+
else if (rhsLocations.contains(lhsLocations))
|
|
83
|
+
return Subset;
|
|
84
|
+
else
|
|
85
|
+
return Overlap;
|
|
86
|
+
}
|
|
87
|
+
else
|
|
88
|
+
{
|
|
89
|
+
return NonOverlap;
|
|
146
90
|
}
|
|
147
|
-
|
|
148
|
-
return result;
|
|
149
91
|
}
|
|
150
92
|
|
|
151
|
-
|
|
152
|
-
|
|
93
|
+
/// Dump location set
|
|
94
|
+
std::string LocationSet::dump() const
|
|
95
|
+
{
|
|
96
|
+
std::string str;
|
|
97
|
+
raw_string_ostream rawstr(str);
|
|
98
|
+
|
|
99
|
+
rawstr << "LocationSet\tField_Index: " << accumulateConstantOffset();
|
|
100
|
+
rawstr << ",\tNum-Stride: {";
|
|
101
|
+
const OffsetValueVec& vec = getOffsetValueVec();
|
|
102
|
+
OffsetValueVec::const_iterator it = vec.begin();
|
|
103
|
+
OffsetValueVec::const_iterator eit = vec.end();
|
|
104
|
+
for (; it != eit; ++it)
|
|
105
|
+
{
|
|
106
|
+
rawstr << " (" << value2String(*it) << ")";
|
|
107
|
+
}
|
|
108
|
+
rawstr << " }\n";
|
|
109
|
+
return rawstr.str();
|
|
110
|
+
}
|
|
@@ -53,7 +53,6 @@ using namespace SVFUtil;
|
|
|
53
53
|
using namespace cppUtil;
|
|
54
54
|
|
|
55
55
|
|
|
56
|
-
CommonCHGraph* PointerAnalysis::chgraph = nullptr;
|
|
57
56
|
SVFIR* PointerAnalysis::pag = nullptr;
|
|
58
57
|
|
|
59
58
|
const std::string PointerAnalysis::aliasTestMayAlias = "MAYALIAS";
|
|
@@ -73,7 +72,7 @@ const std::string PointerAnalysis::aliasTestFailNoAliasMangled = "_Z20EXPECTEDF
|
|
|
73
72
|
* Constructor
|
|
74
73
|
*/
|
|
75
74
|
PointerAnalysis::PointerAnalysis(SVFIR* p, PTATY ty, bool alias_check) :
|
|
76
|
-
svfMod(nullptr),ptaTy(ty),stat(nullptr),ptaCallGraph(nullptr),callGraphSCC(nullptr),icfg(nullptr),typeSystem(nullptr)
|
|
75
|
+
svfMod(nullptr),ptaTy(ty),stat(nullptr),ptaCallGraph(nullptr),callGraphSCC(nullptr),icfg(nullptr),typeSystem(nullptr), chgraph(nullptr)
|
|
77
76
|
{
|
|
78
77
|
pag = p;
|
|
79
78
|
OnTheFlyIterBudgetForStat = Options::StatBudget;
|
|
@@ -103,6 +102,9 @@ void PointerAnalysis::destroy()
|
|
|
103
102
|
|
|
104
103
|
delete stat;
|
|
105
104
|
stat = nullptr;
|
|
105
|
+
|
|
106
|
+
delete chgraph;
|
|
107
|
+
chgraph = nullptr;
|
|
106
108
|
}
|
|
107
109
|
|
|
108
110
|
/*!
|
|
@@ -150,11 +150,11 @@ void BVDataPTAImpl::writeToFile(const string& filename)
|
|
|
150
150
|
for (auto it = pag->begin(), ie = pag->end(); it != ie; ++it)
|
|
151
151
|
{
|
|
152
152
|
PAGNode* pagNode = it->second;
|
|
153
|
-
if (
|
|
153
|
+
if (GepObjVar *gepObjPN = SVFUtil::dyn_cast<GepObjVar>(pagNode))
|
|
154
154
|
{
|
|
155
155
|
F.os() << it->first << " ";
|
|
156
156
|
F.os() << pag->getBaseObjVar(it->first) << " ";
|
|
157
|
-
F.os() << gepObjPN->
|
|
157
|
+
F.os() << gepObjPN->getOffset() << "\n";
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
@@ -411,7 +411,7 @@ void BVDataPTAImpl::normalizePointsTo() {
|
|
|
411
411
|
assert(memObj && "Invalid memobj in memToFieldsMap");
|
|
412
412
|
if (memObj->isFieldInsensitive()) {
|
|
413
413
|
for (NodeID id : t.second) {
|
|
414
|
-
if (SVFUtil::isa<
|
|
414
|
+
if (SVFUtil::isa<GepObjVar>(pag->getGNode(id))) {
|
|
415
415
|
dropNodes.set(id);
|
|
416
416
|
} else
|
|
417
417
|
assert(id == base && "Not a GepObj Node or a baseObj Node?");
|
|
@@ -437,7 +437,7 @@ void BVDataPTAImpl::normalizePointsTo() {
|
|
|
437
437
|
// and remove those nodes from pag
|
|
438
438
|
for (NodeID n: dropNodes) {
|
|
439
439
|
NodeID base = pag->getBaseObjVar(n);
|
|
440
|
-
|
|
440
|
+
GepObjVar *gepNode = SVFUtil::dyn_cast<GepObjVar>(pag->getGNode(n));
|
|
441
441
|
const LocationSet ls = gepNode->getLocationSet();
|
|
442
442
|
GepObjVarMap.erase(std::make_pair(base, ls));
|
|
443
443
|
memToFieldsMap[base].reset(n);
|
|
@@ -383,7 +383,7 @@ NodeID SVFIR::addGepValNode(const Value* curInst,const Value* gepVal, const Loca
|
|
|
383
383
|
NodeID SVFIR::getGepObjVar(NodeID id, const LocationSet& ls)
|
|
384
384
|
{
|
|
385
385
|
SVFVar* node = pag->getGNode(id);
|
|
386
|
-
if (
|
|
386
|
+
if (GepObjVar* gepNode = SVFUtil::dyn_cast<GepObjVar>(node))
|
|
387
387
|
return getGepObjVar(gepNode->getMemObj(), gepNode->getLocationSet() + ls);
|
|
388
388
|
else if (FIObjVar* baseNode = SVFUtil::dyn_cast<FIObjVar>(node))
|
|
389
389
|
return getGepObjVar(baseNode->getMemObj(), ls);
|
|
@@ -413,7 +413,7 @@ NodeID SVFIR::getGepObjVar(const MemObj* obj, const LocationSet& ls)
|
|
|
413
413
|
LocationSet newLS = SymbolTableInfo::SymbolInfo()->getModulusOffset(obj,ls);
|
|
414
414
|
|
|
415
415
|
// Base and first field are the same memory location.
|
|
416
|
-
if (Options::FirstFieldEqBase && newLS.
|
|
416
|
+
if (Options::FirstFieldEqBase && newLS.accumulateConstantOffset() == 0) return base;
|
|
417
417
|
|
|
418
418
|
NodeLocationSetMap::iterator iter = GepObjVarMap.find(std::make_pair(base, newLS));
|
|
419
419
|
if (iter == GepObjVarMap.end())
|
|
@@ -433,9 +433,9 @@ NodeID SVFIR::addGepObjNode(const MemObj* obj, const LocationSet& ls)
|
|
|
433
433
|
assert(0==GepObjVarMap.count(std::make_pair(base, ls))
|
|
434
434
|
&& "this node should not be created before");
|
|
435
435
|
|
|
436
|
-
NodeID gepId = NodeIDAllocator::get()->allocateGepObjectId(base, ls.
|
|
436
|
+
NodeID gepId = NodeIDAllocator::get()->allocateGepObjectId(base, ls.accumulateConstantOffset(), StInfo::getMaxFieldLimit());
|
|
437
437
|
GepObjVarMap[std::make_pair(base, ls)] = gepId;
|
|
438
|
-
|
|
438
|
+
GepObjVar *node = new GepObjVar(obj, gepId, ls);
|
|
439
439
|
memToFieldsMap[base].set(gepId);
|
|
440
440
|
return addObjNode(obj->getValue(), node, gepId);
|
|
441
441
|
}
|
|
@@ -141,10 +141,10 @@ const std::string GepValVar::toString() const {
|
|
|
141
141
|
return rawstr.str();
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
const std::string
|
|
144
|
+
const std::string GepObjVar::toString() const {
|
|
145
145
|
std::string str;
|
|
146
146
|
raw_string_ostream rawstr(str);
|
|
147
|
-
rawstr << "
|
|
147
|
+
rawstr << "GepObjVar ID: " << getId() << " with offset_" + llvm::itostr(ls.accumulateConstantOffset());
|
|
148
148
|
if (Options::PAGDotGraphShorter) {
|
|
149
149
|
rawstr << "\n";
|
|
150
150
|
}
|