svf-tools 1.0.404 → 1.0.407
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/AndersenSFR_8cpp_source.html +4 -4
- package/SVF-doxygen/html/html/AndersenSFR_8h_source.html +2 -2
- package/SVF-doxygen/html/html/CHGBuilder_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/CHG_8h_source.html +5 -6
- package/SVF-doxygen/html/html/CPPUtil_8cpp.html +3 -3
- package/SVF-doxygen/html/html/CPPUtil_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/CSC_8cpp_source.html +4 -4
- package/SVF-doxygen/html/html/CSC_8h_source.html +3 -3
- package/SVF-doxygen/html/html/Conditions_8cpp_source.html +1 -2
- package/SVF-doxygen/html/html/ConsGEdge_8h_source.html +4 -4
- package/SVF-doxygen/html/html/ConsG_8h_source.html +2 -2
- package/SVF-doxygen/html/html/ContextDDA_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/DDAVFSolver_8h_source.html +6 -6
- package/SVF-doxygen/html/html/FlowDDA_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/FlowSensitiveStat_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/FlowSensitiveTBHC_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/Graph2Json_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/ICFGBuilder_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/ICFGEdge_8h_source.html +5 -5
- package/SVF-doxygen/html/html/ICFG_8cpp_source.html +4 -4
- package/SVF-doxygen/html/html/ICFG_8h_source.html +3 -3
- package/SVF-doxygen/html/html/IRAnnotator_8h_source.html +3 -3
- package/SVF-doxygen/html/html/IRGraph_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/IRGraph_8h_source.html +16 -16
- package/SVF-doxygen/html/html/LLVMUtil_8cpp_source.html +16 -13
- package/SVF-doxygen/html/html/LLVMUtil_8h.html +3 -0
- package/SVF-doxygen/html/html/LLVMUtil_8h_source.html +20 -19
- package/SVF-doxygen/html/html/LocationSet_8cpp_source.html +8 -8
- package/SVF-doxygen/html/html/LocationSet_8h_source.html +7 -7
- package/SVF-doxygen/html/html/MHP_8cpp.html +2 -2
- package/SVF-doxygen/html/html/MHP_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/MemRegion_8cpp_source.html +6 -6
- package/SVF-doxygen/html/html/MemSSA_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/PAGBuilderFromFile_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/PAGBuilderFromFile_8h_source.html +3 -3
- package/SVF-doxygen/html/html/PTAStat_8cpp_source.html +16 -16
- package/SVF-doxygen/html/html/PathCondAllocator_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/PointerAnalysisImpl_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/PointerAnalysis_8cpp_source.html +6 -6
- package/SVF-doxygen/html/html/PointerAnalysis_8h_source.html +5 -5
- package/SVF-doxygen/html/html/SVFIRBuilder_8cpp_source.html +25 -25
- package/SVF-doxygen/html/html/SVFIRBuilder_8h_source.html +5 -5
- package/SVF-doxygen/html/html/SVFIR_8cpp_source.html +11 -11
- package/SVF-doxygen/html/html/SVFIR_8h_source.html +13 -13
- package/SVF-doxygen/html/html/SVFModule_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/SVFStatements_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/SVFStatements_8h_source.html +6 -6
- package/SVF-doxygen/html/html/SVFVariables_8h_source.html +11 -11
- package/SVF-doxygen/html/html/SaberSVFGBuilder_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/SymbolTableBuilder_8cpp_source.html +48 -52
- package/SVF-doxygen/html/html/SymbolTableBuilder_8h_source.html +16 -17
- package/SVF-doxygen/html/html/SymbolTableInfo_8cpp_source.html +89 -90
- package/SVF-doxygen/html/html/SymbolTableInfo_8h_source.html +118 -120
- 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 +6 -6
- 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/VersionedFlowSensitiveStat_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1AndersenSFR-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenSFR.html +12 -12
- package/SVF-doxygen/html/html/classSVF_1_1BVDataPTAImpl.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1BranchStmt-members.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1BranchStmt.html +20 -20
- package/SVF-doxygen/html/html/classSVF_1_1BranchVFGNode.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1CHGBuilder.html +5 -5
- package/SVF-doxygen/html/html/classSVF_1_1CHGraph-members.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1CHGraph.html +24 -24
- package/SVF-doxygen/html/html/classSVF_1_1CSC-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1CSC.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1CloneGepObjVar-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1CloneGepObjVar.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1CondManager.html +1 -2
- package/SVF-doxygen/html/html/classSVF_1_1ContextDDA.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1DDAVFSolver.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FlowDDA.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitive.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveStat.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveTBHC.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1GepObjVar-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1GepObjVar.html +15 -15
- package/SVF-doxygen/html/html/classSVF_1_1GepStmt-members.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1GepStmt.html +15 -15
- package/SVF-doxygen/html/html/classSVF_1_1GepValVar-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1GepValVar.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1ICFG-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1ICFG.html +7 -7
- package/SVF-doxygen/html/html/classSVF_1_1ICFGBuilder.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1ICFGPrinter-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1ICFGPrinter.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1IRAnnotator.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1IRGraph.html +17 -17
- package/SVF-doxygen/html/html/classSVF_1_1IntraCFGEdge-members.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1IntraCFGEdge.html +23 -23
- package/SVF-doxygen/html/html/classSVF_1_1LocationSet-members.html +5 -5
- package/SVF-doxygen/html/html/classSVF_1_1LocationSet.html +52 -52
- package/SVF-doxygen/html/html/classSVF_1_1MRGenerator.html +7 -7
- package/SVF-doxygen/html/html/classSVF_1_1MemObj.html +85 -89
- package/SVF-doxygen/html/html/classSVF_1_1MemSSA.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1NormalGepCGEdge-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1NormalGepCGEdge.html +8 -8
- package/SVF-doxygen/html/html/classSVF_1_1ObjTypeInfo-members.html +13 -10
- package/SVF-doxygen/html/html/classSVF_1_1ObjTypeInfo.html +190 -92
- package/SVF-doxygen/html/html/classSVF_1_1ObjVar.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1PAGBuilderFromFile-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1PAGBuilderFromFile.html +8 -8
- package/SVF-doxygen/html/html/classSVF_1_1PTAStat.html +17 -17
- package/SVF-doxygen/html/html/classSVF_1_1PathCondAllocator.html +6 -6
- package/SVF-doxygen/html/html/classSVF_1_1PointerAnalysis.html +9 -9
- package/SVF-doxygen/html/html/classSVF_1_1SVFIR-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1SVFIR.html +36 -36
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder-members.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +60 -60
- package/SVF-doxygen/html/html/classSVF_1_1SVFModule.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1SVFVar.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1SaberSVFGBuilder.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1StInfo-members.html +10 -13
- package/SVF-doxygen/html/html/classSVF_1_1StInfo.html +40 -137
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableBuilder-members.html +6 -7
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableBuilder.html +99 -132
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo-members.html +35 -36
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo.html +184 -213
- package/SVF-doxygen/html/html/classSVF_1_1ThreadCallGraph.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1TypeAnalysis.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1TypeBasedHeapCloning.html +7 -7
- package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitiveStat.html +3 -3
- package/SVF-doxygen/html/html/dda_8cpp.html +1 -1
- package/SVF-doxygen/html/html/dda_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/functions_a.html +6 -6
- package/SVF-doxygen/html/html/functions_b.html +1 -1
- package/SVF-doxygen/html/html/functions_e.html +3 -0
- package/SVF-doxygen/html/html/functions_f.html +2 -2
- package/SVF-doxygen/html/html/functions_func.html +6 -6
- package/SVF-doxygen/html/html/functions_func_f.html +1 -1
- package/SVF-doxygen/html/html/functions_func_g.html +18 -21
- package/SVF-doxygen/html/html/functions_func_i.html +1 -1
- package/SVF-doxygen/html/html/functions_func_s.html +5 -5
- package/SVF-doxygen/html/html/functions_func_v.html +1 -1
- package/SVF-doxygen/html/html/functions_g.html +16 -19
- package/SVF-doxygen/html/html/functions_i.html +5 -5
- package/SVF-doxygen/html/html/functions_l.html +6 -6
- package/SVF-doxygen/html/html/functions_m.html +1 -5
- package/SVF-doxygen/html/html/functions_n.html +1 -1
- package/SVF-doxygen/html/html/functions_o.html +9 -9
- package/SVF-doxygen/html/html/functions_p.html +9 -9
- package/SVF-doxygen/html/html/functions_r.html +1 -1
- package/SVF-doxygen/html/html/functions_s.html +16 -18
- package/SVF-doxygen/html/html/functions_t.html +7 -7
- package/SVF-doxygen/html/html/functions_type_n.html +1 -1
- package/SVF-doxygen/html/html/functions_type_s.html +1 -1
- package/SVF-doxygen/html/html/functions_v.html +3 -3
- package/SVF-doxygen/html/html/functions_vars_b.html +1 -1
- package/SVF-doxygen/html/html/functions_vars_e.html +3 -0
- package/SVF-doxygen/html/html/functions_vars_f.html +1 -1
- package/SVF-doxygen/html/html/functions_vars_m.html +0 -4
- package/SVF-doxygen/html/html/functions_vars_v.html +2 -2
- package/SVF-doxygen/html/html/functions_w.html +9 -5
- package/SVF-doxygen/html/html/globals_r.html +3 -3
- package/SVF-doxygen/html/html/globals_s.html +5 -7
- package/SVF-doxygen/html/html/mta_8cpp.html +1 -1
- package/SVF-doxygen/html/html/mta_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/namespaceSVF_1_1SVFUtil.html +73 -41
- package/SVF-doxygen/html/html/namespaceSVF_1_1cppUtil.html +2 -2
- package/SVF-doxygen/html/html/namespacemembers_func.html +4 -1
- package/SVF-doxygen/html/html/namespacemembers_g.html +3 -0
- package/SVF-doxygen/html/html/saber_8cpp.html +1 -1
- package/SVF-doxygen/html/html/saber_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/search/all_1.js +4 -4
- package/SVF-doxygen/html/html/search/all_10.js +7 -7
- package/SVF-doxygen/html/html/search/all_12.js +2 -2
- package/SVF-doxygen/html/html/search/all_13.js +12 -12
- package/SVF-doxygen/html/html/search/all_14.js +5 -5
- package/SVF-doxygen/html/html/search/all_16.js +3 -3
- package/SVF-doxygen/html/html/search/all_17.js +1 -1
- package/SVF-doxygen/html/html/search/all_2.js +1 -1
- package/SVF-doxygen/html/html/search/all_5.js +1 -0
- package/SVF-doxygen/html/html/search/all_6.js +2 -2
- package/SVF-doxygen/html/html/search/all_7.js +7 -7
- package/SVF-doxygen/html/html/search/all_9.js +3 -3
- package/SVF-doxygen/html/html/search/all_c.js +4 -4
- package/SVF-doxygen/html/html/search/all_d.js +2 -2
- package/SVF-doxygen/html/html/search/all_e.js +5 -5
- package/SVF-doxygen/html/html/search/all_f.js +1 -1
- package/SVF-doxygen/html/html/search/functions_0.js +4 -4
- package/SVF-doxygen/html/html/search/functions_10.js +4 -4
- package/SVF-doxygen/html/html/search/functions_13.js +1 -1
- package/SVF-doxygen/html/html/search/functions_5.js +1 -1
- package/SVF-doxygen/html/html/search/functions_6.js +7 -7
- package/SVF-doxygen/html/html/search/functions_8.js +2 -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/typedefs_11.js +1 -1
- package/SVF-doxygen/html/html/search/typedefs_d.js +1 -1
- package/SVF-doxygen/html/html/search/variables_14.js +2 -2
- package/SVF-doxygen/html/html/search/variables_16.js +2 -2
- package/SVF-doxygen/html/html/search/variables_2.js +1 -1
- package/SVF-doxygen/html/html/search/variables_5.js +1 -0
- package/SVF-doxygen/html/html/search/variables_6.js +1 -1
- package/SVF-doxygen/html/html/search/variables_d.js +1 -1
- package/SVF-doxygen/html/html/search/variables_e.js +3 -3
- package/SVF-doxygen/html/html/structstd_1_1hash_3_01SVF_1_1LocationSet_01_4.html +2 -2
- package/SVF-doxygen/html/html/svf-ex_8cpp.html +1 -1
- package/SVF-doxygen/html/html/svf-ex_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/wpa_8cpp.html +1 -1
- package/SVF-doxygen/html/html/wpa_8cpp_source.html +1 -1
- package/include/Graphs/CHG.h +6 -6
- package/include/Graphs/ConsGEdge.h +1 -1
- package/include/Graphs/ICFG.h +1 -1
- package/include/Graphs/ICFGEdge.h +3 -3
- package/include/MemoryModel/LocationSet.h +5 -5
- package/include/MemoryModel/PAGBuilderFromFile.h +1 -1
- package/include/MemoryModel/SVFIR.h +1 -1
- package/include/MemoryModel/SVFStatements.h +4 -4
- package/include/MemoryModel/SVFVariables.h +2 -2
- package/include/MemoryModel/SymbolTableInfo.h +16 -15
- package/include/SVF-FE/LLVMUtil.h +3 -0
- package/include/SVF-FE/SVFIRBuilder.h +2 -2
- package/include/SVF-FE/SymbolTableBuilder.h +0 -2
- package/include/Util/IRAnnotator.h +2 -2
- package/include/WPA/AndersenSFR.h +1 -1
- package/include/WPA/CSC.h +1 -1
- package/lib/Graphs/ICFG.cpp +1 -1
- package/lib/MTA/MHP.cpp +2 -2
- package/lib/MemoryModel/LocationSet.cpp +3 -3
- package/lib/MemoryModel/PAGBuilderFromFile.cpp +2 -2
- package/lib/MemoryModel/SVFIR.cpp +2 -2
- package/lib/MemoryModel/SymbolTableInfo.cpp +7 -18
- package/lib/SVF-FE/CPPUtil.cpp +4 -4
- package/lib/SVF-FE/ICFGBuilder.cpp +1 -1
- package/lib/SVF-FE/LLVMUtil.cpp +22 -5
- package/lib/SVF-FE/SVFIRBuilder.cpp +9 -9
- package/lib/SVF-FE/SymbolTableBuilder.cpp +3 -22
- package/lib/Util/Conditions.cpp +1 -1
- package/lib/Util/TypeBasedHeapCloning.cpp +1 -1
- package/lib/WPA/AndersenSFR.cpp +6 -6
- package/lib/WPA/CSC.cpp +5 -5
- package/lib/WPA/TypeAnalysis.cpp +3 -3
- package/package.json +1 -1
package/lib/MTA/MHP.cpp
CHANGED
|
@@ -1045,7 +1045,7 @@ static bool accessSameArrayIndex(const GetElementPtrInst* ptr1, const GetElement
|
|
|
1045
1045
|
{
|
|
1046
1046
|
if(ConstantInt* ci = SVFUtil::dyn_cast<ConstantInt>(gi.getOperand()))
|
|
1047
1047
|
{
|
|
1048
|
-
|
|
1048
|
+
s32_t idx = ci->getSExtValue();
|
|
1049
1049
|
ptr1vec.push_back(idx);
|
|
1050
1050
|
}
|
|
1051
1051
|
else
|
|
@@ -1058,7 +1058,7 @@ static bool accessSameArrayIndex(const GetElementPtrInst* ptr1, const GetElement
|
|
|
1058
1058
|
{
|
|
1059
1059
|
if(ConstantInt* ci = SVFUtil::dyn_cast<ConstantInt>(gi.getOperand()))
|
|
1060
1060
|
{
|
|
1061
|
-
|
|
1061
|
+
s32_t idx = ci->getSExtValue();
|
|
1062
1062
|
ptr2vec.push_back(idx);
|
|
1063
1063
|
}
|
|
1064
1064
|
else
|
|
@@ -108,14 +108,14 @@ u32_t LocationSet::getElementNum(const Type* type) const{
|
|
|
108
108
|
/// value1: i64 0 type1: [3 x i8]*
|
|
109
109
|
/// value2: i64 2 type2: [3 x i8]
|
|
110
110
|
/// accumulateConstantOffset = 2
|
|
111
|
-
|
|
111
|
+
s32_t LocationSet::accumulateConstantOffset() const{
|
|
112
112
|
|
|
113
113
|
assert(isConstantOffset() && "not a constant offset");
|
|
114
114
|
|
|
115
115
|
if(offsetValues.empty())
|
|
116
116
|
return accumulateConstantFieldIdx();
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
s32_t totalConstOffset = 0;
|
|
119
119
|
for(int i = offsetValues.size() - 1; i >= 0; i--){
|
|
120
120
|
const Value* value = offsetValues[i].first;
|
|
121
121
|
const Type* type = offsetValues[i].second;
|
|
@@ -129,7 +129,7 @@ s64_t LocationSet::accumulateConstantOffset() const{
|
|
|
129
129
|
if(const PointerType* pty = SVFUtil::dyn_cast<PointerType>(type))
|
|
130
130
|
totalConstOffset += op->getSExtValue() * getElementNum(pty->getElementType());
|
|
131
131
|
else{
|
|
132
|
-
|
|
132
|
+
s32_t offset = op->getSExtValue();
|
|
133
133
|
u32_t flattenOffset = SymbolTableInfo::SymbolInfo()->getFlattenedElemIdx(type, offset);
|
|
134
134
|
totalConstOffset += flattenOffset;
|
|
135
135
|
}
|
|
@@ -103,7 +103,7 @@ SVFIR* PAGBuilderFromFile::build()
|
|
|
103
103
|
{
|
|
104
104
|
NodeID nodeSrc;
|
|
105
105
|
NodeID nodeDst;
|
|
106
|
-
|
|
106
|
+
s32_t offsetOrCSId;
|
|
107
107
|
string edge;
|
|
108
108
|
istringstream ss(line);
|
|
109
109
|
ss >> nodeSrc;
|
|
@@ -144,7 +144,7 @@ SVFIR* PAGBuilderFromFile::build()
|
|
|
144
144
|
* Add SVFIR edge according to a file format
|
|
145
145
|
*/
|
|
146
146
|
void PAGBuilderFromFile::addEdge(NodeID srcID, NodeID dstID,
|
|
147
|
-
|
|
147
|
+
s32_t offsetOrCSId, std::string edge)
|
|
148
148
|
{
|
|
149
149
|
|
|
150
150
|
//check whether these two nodes available
|
|
@@ -455,7 +455,7 @@ NodeID SVFIR::addGepObjNode(const MemObj* obj, const LocationSet& ls)
|
|
|
455
455
|
assert(0==GepObjVarMap.count(std::make_pair(base, ls))
|
|
456
456
|
&& "this node should not be created before");
|
|
457
457
|
|
|
458
|
-
NodeID gepId = NodeIDAllocator::get()->allocateGepObjectId(base, ls.accumulateConstantFieldIdx(),
|
|
458
|
+
NodeID gepId = NodeIDAllocator::get()->allocateGepObjectId(base, ls.accumulateConstantFieldIdx(), Options::MaxFieldLimit);
|
|
459
459
|
GepObjVarMap[std::make_pair(base, ls)] = gepId;
|
|
460
460
|
GepObjVar *node = new GepObjVar(obj, gepId, ls);
|
|
461
461
|
memToFieldsMap[base].set(gepId);
|
|
@@ -559,7 +559,7 @@ NodeID SVFIR::getGepValVar(const Value* curInst, NodeID base, const LocationSet&
|
|
|
559
559
|
* Get a base SVFVar given a pointer
|
|
560
560
|
* Return the source node of its connected normal gep edge
|
|
561
561
|
* Otherwise return the node id itself
|
|
562
|
-
*
|
|
562
|
+
* s32_t offset : gep offset
|
|
563
563
|
*/
|
|
564
564
|
LocationSet SVFIR::getLocationSetFromBaseNode(NodeID nodeId)
|
|
565
565
|
{
|
|
@@ -41,10 +41,9 @@ using namespace SVFUtil;
|
|
|
41
41
|
|
|
42
42
|
DataLayout* SymbolTableInfo::dl = nullptr;
|
|
43
43
|
SymbolTableInfo* SymbolTableInfo::symInfo = nullptr;
|
|
44
|
-
u32_t StInfo::maxFieldLimit = 0;
|
|
45
44
|
|
|
46
45
|
|
|
47
|
-
ObjTypeInfo::ObjTypeInfo(const Type* t, u32_t max) : type(t), flags(0), maxOffsetLimit(max)
|
|
46
|
+
ObjTypeInfo::ObjTypeInfo(const Type* t, u32_t max) : type(t), flags(0), maxOffsetLimit(max), elemNum(max)
|
|
48
47
|
{
|
|
49
48
|
assert(t && "no type information for this object?");
|
|
50
49
|
}
|
|
@@ -93,7 +92,7 @@ SymbolTableInfo::TypeToFieldInfoMap::iterator SymbolTableInfo::getStructInfoIter
|
|
|
93
92
|
*/
|
|
94
93
|
ObjTypeInfo* SymbolTableInfo::createObjTypeInfo(const Type* type)
|
|
95
94
|
{
|
|
96
|
-
ObjTypeInfo* typeInfo = new ObjTypeInfo(type,
|
|
95
|
+
ObjTypeInfo* typeInfo = new ObjTypeInfo(type, Options::MaxFieldLimit);
|
|
97
96
|
if(type && type->isPointerTy()){
|
|
98
97
|
typeInfo->setFlag(ObjTypeInfo::HEAP_OBJ);
|
|
99
98
|
typeInfo->setFlag(ObjTypeInfo::HASPTR_OBJ);
|
|
@@ -200,7 +199,7 @@ void SymbolTableInfo::collectStructInfo(const StructType *sty)
|
|
|
200
199
|
sty->element_end(); it != ie; ++it)
|
|
201
200
|
{
|
|
202
201
|
const Type *et = *it;
|
|
203
|
-
/// offset with int_32 (
|
|
202
|
+
/// offset with int_32 (s32_t) is large enough and will not cause overflow
|
|
204
203
|
stinfo->addFldWithType(nf, et, strideOffset);
|
|
205
204
|
|
|
206
205
|
if (SVFUtil::isa<StructType>(et) || SVFUtil::isa<ArrayType>(et))
|
|
@@ -269,7 +268,7 @@ LocationSet SymbolTableInfo::getModulusOffset(const MemObj* obj, const LocationS
|
|
|
269
268
|
/// of current struct. Make the offset positive so we can still get a node within current
|
|
270
269
|
/// struct to represent this obj.
|
|
271
270
|
|
|
272
|
-
|
|
271
|
+
s32_t offset = ls.accumulateConstantFieldIdx();
|
|
273
272
|
if(offset < 0)
|
|
274
273
|
{
|
|
275
274
|
writeWrnMsg("try to create a gep node with negative offset.");
|
|
@@ -405,7 +404,7 @@ u32_t SymbolTableInfo::getNumOfFlattenElements(const Type *T)
|
|
|
405
404
|
}
|
|
406
405
|
|
|
407
406
|
/// Flatterned offset information of a struct or an array including its array fields
|
|
408
|
-
u32_t SymbolTableInfo::getFlattenedElemIdx(const Type *T,
|
|
407
|
+
u32_t SymbolTableInfo::getFlattenedElemIdx(const Type *T, u32_t origId)
|
|
409
408
|
{
|
|
410
409
|
if(Options::ModelArrays){
|
|
411
410
|
std::vector<u32_t>& so = getStructInfoIter(T)->second->getFlattenedElemIdxVec();
|
|
@@ -624,7 +623,7 @@ bool ObjTypeInfo::isNonPtrFieldObj(const LocationSet& ls)
|
|
|
624
623
|
*/
|
|
625
624
|
void MemObj::setFieldSensitive()
|
|
626
625
|
{
|
|
627
|
-
typeInfo->setMaxFieldOffsetLimit(
|
|
626
|
+
typeInfo->setMaxFieldOffsetLimit(typeInfo->getNumOfElements());
|
|
628
627
|
}
|
|
629
628
|
|
|
630
629
|
|
|
@@ -648,17 +647,7 @@ bool MemObj::isBlackHoleObj() const
|
|
|
648
647
|
/// Get obj type info
|
|
649
648
|
const Type* MemObj::getType() const
|
|
650
649
|
{
|
|
651
|
-
|
|
652
|
-
{
|
|
653
|
-
if(const PointerType* type = SVFUtil::dyn_cast<PointerType>(typeInfo->getType()))
|
|
654
|
-
return type->getElementType();
|
|
655
|
-
else
|
|
656
|
-
return typeInfo->getType();
|
|
657
|
-
}
|
|
658
|
-
else if (getValue() && SVFUtil::isa<Instruction>(getValue()))
|
|
659
|
-
return SVFUtil::getTypeOfHeapAlloc(SVFUtil::cast<Instruction>(getValue()));
|
|
660
|
-
else
|
|
661
|
-
return typeInfo->getType();
|
|
650
|
+
return typeInfo->getType();
|
|
662
651
|
}
|
|
663
652
|
/*
|
|
664
653
|
* Destroy the fields of the memory object
|
package/lib/SVF-FE/CPPUtil.cpp
CHANGED
|
@@ -55,7 +55,7 @@ const string structName = "struct.";
|
|
|
55
55
|
|
|
56
56
|
static bool isOperOverload(const string name)
|
|
57
57
|
{
|
|
58
|
-
|
|
58
|
+
u32_t leftnum = 0, rightnum = 0;
|
|
59
59
|
string subname = name;
|
|
60
60
|
size_t leftpos, rightpos;
|
|
61
61
|
leftpos = subname.find("<");
|
|
@@ -88,7 +88,7 @@ static string getBeforeParenthesis(const string &name)
|
|
|
88
88
|
size_t lastRightParen = name.rfind(")");
|
|
89
89
|
assert(lastRightParen > 0);
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
s32_t paren_num = 1, pos;
|
|
92
92
|
for (pos = lastRightParen - 1; pos >= 0; pos--)
|
|
93
93
|
{
|
|
94
94
|
if (name[pos] == ')')
|
|
@@ -107,7 +107,7 @@ string cppUtil::getBeforeBrackets(const string &name)
|
|
|
107
107
|
{
|
|
108
108
|
return name;
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
s32_t bracket_num = 1, pos;
|
|
111
111
|
for (pos = name.size() - 2; pos >= 0; pos--)
|
|
112
112
|
{
|
|
113
113
|
if (name[pos] == '>')
|
|
@@ -228,7 +228,7 @@ bool cppUtil::isLoadVtblInst(const LoadInst *loadInst)
|
|
|
228
228
|
const Value *loadSrc = loadInst->getPointerOperand();
|
|
229
229
|
const Type *valTy = loadSrc->getType();
|
|
230
230
|
const Type *elemTy = valTy;
|
|
231
|
-
for (
|
|
231
|
+
for (u32_t i = 0; i < 3; ++i)
|
|
232
232
|
{
|
|
233
233
|
if (const PointerType *ptrTy = SVFUtil::dyn_cast<PointerType>(elemTy))
|
|
234
234
|
elemTy = ptrTy->getElementType();
|
|
@@ -123,7 +123,7 @@ void ICFGBuilder::processFunBody(WorkList& worklist)
|
|
|
123
123
|
/// branch condition value
|
|
124
124
|
const ConstantInt* condVal = const_cast<SwitchInst*>(si)->findCaseDest(const_cast<BasicBlock*>(succ->getParent()));
|
|
125
125
|
/// default case is set to -1;
|
|
126
|
-
|
|
126
|
+
s32_t val = condVal ? condVal->getSExtValue() : -1;
|
|
127
127
|
icfg->addConditionalIntraEdge(srcNode, dstNode, si->getCondition(),val);
|
|
128
128
|
}
|
|
129
129
|
else
|
package/lib/SVF-FE/LLVMUtil.cpp
CHANGED
|
@@ -263,6 +263,23 @@ void SVFUtil::getPrevInsts(const Instruction* curInst, std::vector<const Instruc
|
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
+
/*
|
|
267
|
+
* Get the first dominated cast instruction for heap allocations since they typically come from void* (i8*)
|
|
268
|
+
* for example, %4 = call align 16 i8* @malloc(i64 10); %5 = bitcast i8* %4 to i32*
|
|
269
|
+
* return %5 whose type is i32* but not %4 whose type is i8*
|
|
270
|
+
*/
|
|
271
|
+
const Value* SVFUtil::getUniqueUseViaCastInst(const Value* val){
|
|
272
|
+
const PointerType * type = SVFUtil::dyn_cast<PointerType>(val->getType());
|
|
273
|
+
assert(type && "this value should be a pointer type!");
|
|
274
|
+
/// If type is void* (i8*) and val is only used at a bitcast instruction
|
|
275
|
+
if (IntegerType *IT = SVFUtil::dyn_cast<IntegerType>(type->getPointerElementType())){
|
|
276
|
+
if (IT->getBitWidth() == 8 && val->getNumUses()==1){
|
|
277
|
+
const Use *u = &*val->use_begin();
|
|
278
|
+
return SVFUtil::dyn_cast<BitCastInst>(u->getUser());
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return nullptr;
|
|
282
|
+
}
|
|
266
283
|
|
|
267
284
|
/*!
|
|
268
285
|
* Return the type of the object from a heap allocation
|
|
@@ -273,10 +290,10 @@ const Type* SVFUtil::getTypeOfHeapAlloc(const Instruction *inst)
|
|
|
273
290
|
|
|
274
291
|
if(isHeapAllocExtCallViaRet(inst))
|
|
275
292
|
{
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
293
|
+
if(const Value* v = getUniqueUseViaCastInst(inst)){
|
|
294
|
+
if(const PointerType* newTy = SVFUtil::dyn_cast<PointerType>(v->getType()))
|
|
295
|
+
type = newTy;
|
|
296
|
+
}
|
|
280
297
|
}
|
|
281
298
|
else if(isHeapAllocExtCallViaArg(inst))
|
|
282
299
|
{
|
|
@@ -371,7 +388,7 @@ void SVFUtil::processArguments(int argc, char **argv, int &arg_num, char **arg_v
|
|
|
371
388
|
std::vector<std::string> &moduleNameVec)
|
|
372
389
|
{
|
|
373
390
|
bool first_ir_file = true;
|
|
374
|
-
for (
|
|
391
|
+
for (u32_t i = 0; i < argc; ++i)
|
|
375
392
|
{
|
|
376
393
|
std::string argument(argv[i]);
|
|
377
394
|
if (SVFUtil::isIRFile(argument))
|
|
@@ -219,7 +219,7 @@ void SVFIRBuilder::initialiseNodes()
|
|
|
219
219
|
e.g. field_idx = getelementptr i8, %struct_type %p, i64 1
|
|
220
220
|
|
|
221
221
|
*/
|
|
222
|
-
u32_t SVFIRBuilder::inferFieldIdxFromByteOffset(const llvm::GEPOperator* gepOp, DataLayout *dl, LocationSet& ls,
|
|
222
|
+
u32_t SVFIRBuilder::inferFieldIdxFromByteOffset(const llvm::GEPOperator* gepOp, DataLayout *dl, LocationSet& ls, s32_t idx){
|
|
223
223
|
return 0;
|
|
224
224
|
}
|
|
225
225
|
|
|
@@ -238,7 +238,7 @@ bool SVFIRBuilder::computeGepOffset(const User *V, LocationSet& ls)
|
|
|
238
238
|
llvm::APInt byteOffset(dataLayout->getIndexSizeInBits(gepOp->getPointerAddressSpace()),0,true);
|
|
239
239
|
if(gepOp && dataLayout && gepOp->accumulateConstantOffset(*dataLayout,byteOffset))
|
|
240
240
|
{
|
|
241
|
-
|
|
241
|
+
s32_t bo = byteOffset.getSExtValue();
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
for (bridge_gep_iterator gi = bridge_gep_begin(*V), ge = bridge_gep_end(*V);
|
|
@@ -256,7 +256,7 @@ bool SVFIRBuilder::computeGepOffset(const User *V, LocationSet& ls)
|
|
|
256
256
|
if(SVFUtil::isa<ArrayType>(gepTy)){
|
|
257
257
|
if(!op)
|
|
258
258
|
continue;
|
|
259
|
-
|
|
259
|
+
s32_t idx = op->getSExtValue();
|
|
260
260
|
u32_t offset = SymbolTableInfo::SymbolInfo()->getFlattenedElemIdx(gepTy, idx);
|
|
261
261
|
ls.setFldIdx(ls.accumulateConstantFieldIdx() + offset);
|
|
262
262
|
}
|
|
@@ -264,7 +264,7 @@ bool SVFIRBuilder::computeGepOffset(const User *V, LocationSet& ls)
|
|
|
264
264
|
{
|
|
265
265
|
assert(op && "non-const offset accessing a struct");
|
|
266
266
|
//The actual index
|
|
267
|
-
|
|
267
|
+
s32_t idx = op->getSExtValue();
|
|
268
268
|
u32_t offset = SymbolTableInfo::SymbolInfo()->getFlattenedElemIdx(ST, idx);
|
|
269
269
|
ls.setFldIdx(ls.accumulateConstantFieldIdx() + offset);
|
|
270
270
|
}
|
|
@@ -277,7 +277,7 @@ bool SVFIRBuilder::computeGepOffset(const User *V, LocationSet& ls)
|
|
|
277
277
|
return false;
|
|
278
278
|
|
|
279
279
|
// The actual index
|
|
280
|
-
//
|
|
280
|
+
//s32_t idx = op->getSExtValue();
|
|
281
281
|
|
|
282
282
|
// For pointer arithmetic we ignore the byte offset
|
|
283
283
|
// consider using inferFieldIdxFromByteOffset(geopOp,dataLayout,ls,idx)?
|
|
@@ -871,7 +871,7 @@ void SVFIRBuilder::visitSwitchInst(SwitchInst &inst){
|
|
|
871
871
|
const Instruction* succInst = &inst.getSuccessor(i)->front();
|
|
872
872
|
const ConstantInt* condVal = inst.findCaseDest(inst.getSuccessor(i));
|
|
873
873
|
/// default case is set to -1;
|
|
874
|
-
|
|
874
|
+
s32_t val = condVal ? condVal->getSExtValue() : -1;
|
|
875
875
|
const ICFGNode* icfgNode = pag->getICFG()->getICFGNode(succInst);
|
|
876
876
|
successors.push_back(std::make_pair(icfgNode,val));
|
|
877
877
|
}
|
|
@@ -977,7 +977,7 @@ const Value* SVFIRBuilder::getBaseValueForExtArg(const Value* V){
|
|
|
977
977
|
const Value * value = stripAllCasts(V);
|
|
978
978
|
assert(value && "null ptr?");
|
|
979
979
|
if(const GetElementPtrInst* gep = SVFUtil::dyn_cast<GetElementPtrInst>(value)){
|
|
980
|
-
|
|
980
|
+
s32_t totalidx = 0;
|
|
981
981
|
for (bridge_gep_iterator gi = bridge_gep_begin(gep), ge = bridge_gep_end(gep); gi != ge; ++gi){
|
|
982
982
|
if(const ConstantInt *op = SVFUtil::dyn_cast<ConstantInt>(gi.getOperand()))
|
|
983
983
|
totalidx += op->getSExtValue();
|
|
@@ -1322,7 +1322,7 @@ void SVFIRBuilder::handleExtCall(CallSite cs, const SVFFunction *callee)
|
|
|
1322
1322
|
// We have vArg3 points to the entry of _Rb_tree_node_base { color; parent; left; right; }.
|
|
1323
1323
|
// Now we calculate the offset from base to vArg3
|
|
1324
1324
|
NodeID vnArg3 = pag->getValueNode(vArg3);
|
|
1325
|
-
|
|
1325
|
+
s32_t offset = pag->getLocationSetFromBaseNode(vnArg3).accumulateConstantFieldIdx();
|
|
1326
1326
|
|
|
1327
1327
|
// We get all flattened fields of base
|
|
1328
1328
|
vector<LocationSet> fields;
|
|
@@ -1349,7 +1349,7 @@ void SVFIRBuilder::handleExtCall(CallSite cs, const SVFFunction *callee)
|
|
|
1349
1349
|
|
|
1350
1350
|
Value *vArg = cs.getArgument(0);
|
|
1351
1351
|
NodeID vnArg = pag->getValueNode(vArg);
|
|
1352
|
-
|
|
1352
|
+
s32_t offset = pag->getLocationSetFromBaseNode(vnArg).accumulateConstantFieldIdx();
|
|
1353
1353
|
|
|
1354
1354
|
// We get all fields
|
|
1355
1355
|
vector<LocationSet> fields;
|
|
@@ -51,8 +51,6 @@ void SymbolTableBuilder::buildMemModel(SVFModule* svfModule)
|
|
|
51
51
|
|
|
52
52
|
symInfo->setModule(svfModule);
|
|
53
53
|
|
|
54
|
-
StInfo::setMaxFieldLimit(Options::MaxFieldLimit);
|
|
55
|
-
|
|
56
54
|
// Pointer #0 always represents the null pointer.
|
|
57
55
|
assert(symInfo->totalSymNum++ == SymbolTableInfo::NullPtr && "Something changed!");
|
|
58
56
|
|
|
@@ -586,30 +584,12 @@ void SymbolTableBuilder::analyzeStaticObjType(ObjTypeInfo* typeinfo, const Value
|
|
|
586
584
|
}
|
|
587
585
|
}
|
|
588
586
|
|
|
589
|
-
/*
|
|
590
|
-
* Get the first dominated cast instruction for heap allocations since they typically come from void* (i8*)
|
|
591
|
-
* for example, %4 = call align 16 i8* @malloc(i64 10); %5 = bitcast i8* %4 to i32*
|
|
592
|
-
* return %5 whose type is i32* but not %4 whose type is i8*
|
|
593
|
-
*/
|
|
594
|
-
const Value* SymbolTableBuilder::getUniqueUseViaCastInst(const Value* val){
|
|
595
|
-
const PointerType * type = SVFUtil::dyn_cast<PointerType>(val->getType());
|
|
596
|
-
assert(type && "this value should be a pointer type!");
|
|
597
|
-
/// If type is void* (i8*) and val is only used at a bitcast instruction
|
|
598
|
-
if (IntegerType *IT = SVFUtil::dyn_cast<IntegerType>(type->getPointerElementType())){
|
|
599
|
-
if (IT->getBitWidth() == 8 && val->getNumUses()==1){
|
|
600
|
-
const Use *u = &*val->use_begin();
|
|
601
|
-
return SVFUtil::dyn_cast<BitCastInst>(u->getUser());
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
return nullptr;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
587
|
/*!
|
|
608
588
|
* Initialize the type info of an object
|
|
609
589
|
*/
|
|
610
590
|
void SymbolTableBuilder::initTypeInfo(ObjTypeInfo* typeinfo, const Value* val){
|
|
611
591
|
|
|
612
|
-
|
|
592
|
+
s32_t objSize = 1;
|
|
613
593
|
// Global variable
|
|
614
594
|
if (SVFUtil::isa<Function>(val))
|
|
615
595
|
{
|
|
@@ -652,6 +632,7 @@ void SymbolTableBuilder::initTypeInfo(ObjTypeInfo* typeinfo, const Value* val){
|
|
|
652
632
|
else if(SVFUtil::isConstantData(val))
|
|
653
633
|
{
|
|
654
634
|
typeinfo->setFlag(ObjTypeInfo::CONST_DATA);
|
|
635
|
+
objSize = SymbolTableInfo::SymbolInfo()->getNumOfFlattenElements(val->getType());
|
|
655
636
|
}
|
|
656
637
|
else{
|
|
657
638
|
assert("what other object do we have??");
|
|
@@ -660,7 +641,7 @@ void SymbolTableBuilder::initTypeInfo(ObjTypeInfo* typeinfo, const Value* val){
|
|
|
660
641
|
|
|
661
642
|
// Reset maxOffsetLimit if it is over the total fieldNum of this object
|
|
662
643
|
if(objSize > 0 && typeinfo->getMaxFieldOffsetLimit() > objSize)
|
|
663
|
-
typeinfo->
|
|
644
|
+
typeinfo->setNumOfElements(objSize);
|
|
664
645
|
}
|
|
665
646
|
|
|
666
647
|
/*!
|
package/lib/Util/Conditions.cpp
CHANGED
|
@@ -182,7 +182,7 @@ void CondManager::printModel()
|
|
|
182
182
|
z3::model m = sol.get_model();
|
|
183
183
|
for (u32_t i = 0; i < m.size(); i++)
|
|
184
184
|
{
|
|
185
|
-
z3::func_decl v = m[
|
|
185
|
+
z3::func_decl v = m[i];
|
|
186
186
|
SVFUtil::outs() << v.name() << " = " << m.get_const_interp(v) << "\n";
|
|
187
187
|
}
|
|
188
188
|
}
|
|
@@ -152,7 +152,7 @@ const NodeBS TypeBasedHeapCloning::getGepObjClones(NodeID base, unsigned offset)
|
|
|
152
152
|
|
|
153
153
|
// totalOffset is the offset from the real base (i.e. base of base),
|
|
154
154
|
// offset is the offset into base, whether it is a field itself or not.
|
|
155
|
-
|
|
155
|
+
s32_t totalOffset = offset;
|
|
156
156
|
if (const GepObjVar *baseGep = SVFUtil::dyn_cast<GepObjVar>(baseNode))
|
|
157
157
|
{
|
|
158
158
|
totalOffset += baseGep->getConstantFieldIdx();
|
package/lib/WPA/AndersenSFR.cpp
CHANGED
|
@@ -96,7 +96,7 @@ bool AndersenSFR::processGepPts(PointsTo& pts, const GepCGEdge* edge)
|
|
|
96
96
|
for (NodeID ptd : srcInits)
|
|
97
97
|
sortSrcInits.insert(ptd);
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
s32_t offset = SVFUtil::dyn_cast<NormalGepCGEdge>(edge)->getConstantFieldIdx();
|
|
100
100
|
fieldExpand(sortSrcInits, offset, dst->strides, tmpDstPts);
|
|
101
101
|
}
|
|
102
102
|
|
|
@@ -116,7 +116,7 @@ bool AndersenSFR::processGepPts(PointsTo& pts, const GepCGEdge* edge)
|
|
|
116
116
|
/*!
|
|
117
117
|
*
|
|
118
118
|
*/
|
|
119
|
-
void AndersenSFR::fieldExpand(NodeSet& initials,
|
|
119
|
+
void AndersenSFR::fieldExpand(NodeSet& initials, s32_t offset, NodeBS& strides, PointsTo& expandPts)
|
|
120
120
|
{
|
|
121
121
|
numOfFieldExpand++;
|
|
122
122
|
|
|
@@ -132,7 +132,7 @@ void AndersenSFR::fieldExpand(NodeSet& initials, s64_t offset, NodeBS& strides,
|
|
|
132
132
|
PAGNode* initPN = pag->getGNode(init);
|
|
133
133
|
const MemObj* obj = pag->getBaseObj(init);
|
|
134
134
|
const u32_t maxLimit = obj->getMaxFieldOffsetLimit();
|
|
135
|
-
|
|
135
|
+
s32_t initOffset;
|
|
136
136
|
if (GepObjVar *gepNode = SVFUtil::dyn_cast<GepObjVar>(initPN))
|
|
137
137
|
initOffset = gepNode->getConstantFieldIdx();
|
|
138
138
|
else if (SVFUtil::isa<FIObjVar>(initPN) || SVFUtil::isa<DummyObjVar>(initPN))
|
|
@@ -140,7 +140,7 @@ void AndersenSFR::fieldExpand(NodeSet& initials, s64_t offset, NodeBS& strides,
|
|
|
140
140
|
else
|
|
141
141
|
assert(false && "Not an object node!!");
|
|
142
142
|
|
|
143
|
-
Set<
|
|
143
|
+
Set<s32_t> offsets;
|
|
144
144
|
offsets.insert(offset);
|
|
145
145
|
|
|
146
146
|
// calculate offsets
|
|
@@ -151,7 +151,7 @@ void AndersenSFR::fieldExpand(NodeSet& initials, s64_t offset, NodeBS& strides,
|
|
|
151
151
|
for (auto _f : offsets)
|
|
152
152
|
for (auto _s : strides)
|
|
153
153
|
{
|
|
154
|
-
|
|
154
|
+
s32_t _f1 = _f + _s;
|
|
155
155
|
loopFlag = (offsets.find(_f1) == offsets.end()) && (initOffset + _f1 < maxLimit);
|
|
156
156
|
if (loopFlag)
|
|
157
157
|
offsets.insert(_f1);
|
|
@@ -159,7 +159,7 @@ void AndersenSFR::fieldExpand(NodeSet& initials, s64_t offset, NodeBS& strides,
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
// get gep objs
|
|
162
|
-
for (
|
|
162
|
+
for (s32_t _f : offsets)
|
|
163
163
|
{
|
|
164
164
|
NodeID gepId = consCG->getGepObjVar(init, LocationSet(_f));
|
|
165
165
|
initials.erase(gepId); // gep id in initials should be removed to avoid redundant derivation
|
package/lib/WPA/CSC.cpp
CHANGED
|
@@ -73,7 +73,7 @@ void CSC::find(NodeStack& candidates)
|
|
|
73
73
|
/*!
|
|
74
74
|
*
|
|
75
75
|
*/
|
|
76
|
-
void CSC::visit(NodeID nodeId,
|
|
76
|
+
void CSC::visit(NodeID nodeId, s32_t _w)
|
|
77
77
|
{
|
|
78
78
|
// pwcReps[nodeId] = _scc->repNode(nodeId);
|
|
79
79
|
setVisited(nodeId);
|
|
@@ -85,7 +85,7 @@ void CSC::visit(NodeID nodeId, s64_t _w)
|
|
|
85
85
|
ConstraintNode* node = _consG->getConstraintNode(nodeId);
|
|
86
86
|
for (ConstraintNode::const_iterator eit = node->directOutEdgeBegin(); eit != node->directOutEdgeEnd(); ++eit)
|
|
87
87
|
{
|
|
88
|
-
|
|
88
|
+
s32_t offset;
|
|
89
89
|
if (NormalGepCGEdge* gepCGEdge = SVFUtil::dyn_cast<NormalGepCGEdge>(*eit))
|
|
90
90
|
offset = gepCGEdge->getConstantFieldIdx();
|
|
91
91
|
else
|
|
@@ -107,8 +107,8 @@ void CSC::visit(NodeID nodeId, s64_t _w)
|
|
|
107
107
|
if (_consG->hasEdge(node, backNode, ConstraintEdge::NormalGep))
|
|
108
108
|
{
|
|
109
109
|
NormalGepCGEdge* normalGep = SVFUtil::dyn_cast<NormalGepCGEdge>(_consG->getEdge(node, backNode, ConstraintEdge::NormalGep));
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
s32_t _w = normalGep->getConstantFieldIdx();
|
|
111
|
+
s32_t _l = _D[nodeId] +_w - _D[backNodeId];
|
|
112
112
|
backNode->strides.set(_l);
|
|
113
113
|
for (auto cNodeId : _C)
|
|
114
114
|
_consG->getConstraintNode(cNodeId)->strides.set(_l);
|
|
@@ -116,7 +116,7 @@ void CSC::visit(NodeID nodeId, s64_t _w)
|
|
|
116
116
|
else if (_consG->hasEdge(node, backNode, ConstraintEdge::VariantGep) ||
|
|
117
117
|
_consG->hasEdge(node, backNode, ConstraintEdge::Copy))
|
|
118
118
|
{
|
|
119
|
-
|
|
119
|
+
s32_t _l = _D[nodeId] - _D[backNodeId];
|
|
120
120
|
backNode->strides.set(_l);
|
|
121
121
|
for (auto cNodeId : _C)
|
|
122
122
|
_consG->getConstraintNode(cNodeId)->strides.set(_l);
|
package/lib/WPA/TypeAnalysis.cpp
CHANGED
|
@@ -104,7 +104,7 @@ void TypeAnalysis::dumpCHAStats()
|
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
u32_t pure_abstract_class_num = 0,
|
|
108
108
|
multi_inheritance_class_num = 0;
|
|
109
109
|
for (CHGraph::const_iterator it = chgraph->begin(), eit = chgraph->end();
|
|
110
110
|
it != eit; ++it)
|
|
@@ -127,7 +127,7 @@ void TypeAnalysis::dumpCHAStats()
|
|
|
127
127
|
* vtbl max vfunction
|
|
128
128
|
* pure abstract class
|
|
129
129
|
*/
|
|
130
|
-
|
|
130
|
+
u32_t vtblnum = 0,
|
|
131
131
|
vfunc_total = 0,
|
|
132
132
|
vtbl_max = 0,
|
|
133
133
|
pure_abstract = 0;
|
|
@@ -139,7 +139,7 @@ void TypeAnalysis::dumpCHAStats()
|
|
|
139
139
|
if (node->isPureAbstract())
|
|
140
140
|
pure_abstract++;
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
u32_t vfuncs_size = 0;
|
|
143
143
|
const vector<CHNode::FuncVector>& vecs = node->getVirtualFunctionVectors();
|
|
144
144
|
for (vector<CHNode::FuncVector>::const_iterator vit = vecs.begin(),
|
|
145
145
|
veit = vecs.end(); vit != veit; ++vit)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.407",
|
|
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": {
|