svf-tools 1.0.404 → 1.0.405
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 +3 -3
- package/SVF-doxygen/html/html/AndersenSFR_8h_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/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/LLVMUtil_8cpp_source.html +1 -2
- package/SVF-doxygen/html/html/LocationSet_8cpp_source.html +5 -5
- 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/PAGBuilderFromFile_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/PAGBuilderFromFile_8h_source.html +3 -3
- package/SVF-doxygen/html/html/SVFIRBuilder_8cpp_source.html +5 -5
- package/SVF-doxygen/html/html/SVFIRBuilder_8h_source.html +5 -5
- package/SVF-doxygen/html/html/SVFIR_8cpp_source.html +4 -4
- package/SVF-doxygen/html/html/SVFIR_8h_source.html +3 -3
- package/SVF-doxygen/html/html/SVFStatements_8h_source.html +6 -6
- package/SVF-doxygen/html/html/SVFVariables_8h_source.html +5 -5
- package/SVF-doxygen/html/html/SymbolTableBuilder_8cpp_source.html +1 -2
- package/SVF-doxygen/html/html/SymbolTableInfo_8cpp_source.html +4 -4
- package/SVF-doxygen/html/html/SymbolTableInfo_8h_source.html +2 -3
- package/SVF-doxygen/html/html/TypeAnalysis_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/TypeBasedHeapCloning_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/VFGNode_8h_source.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1AndersenSFR-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenSFR.html +10 -10
- package/SVF-doxygen/html/html/classSVF_1_1BranchStmt-members.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1BranchStmt.html +16 -16
- package/SVF-doxygen/html/html/classSVF_1_1BranchVFGNode.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1CHGBuilder.html +3 -3
- 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_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 +12 -12
- 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_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 +48 -48
- 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.html +2 -2
- 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_1SVFIR-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1SVFIR.html +16 -16
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder-members.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +30 -30
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableBuilder.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo.html +9 -9
- package/SVF-doxygen/html/html/classSVF_1_1TypeAnalysis.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1TypeBasedHeapCloning.html +3 -3
- 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_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 +9 -9
- package/SVF-doxygen/html/html/functions_func_i.html +1 -1
- package/SVF-doxygen/html/html/functions_func_s.html +2 -2
- package/SVF-doxygen/html/html/functions_func_v.html +1 -1
- package/SVF-doxygen/html/html/functions_g.html +9 -9
- package/SVF-doxygen/html/html/functions_i.html +1 -1
- package/SVF-doxygen/html/html/functions_l.html +1 -1
- package/SVF-doxygen/html/html/functions_n.html +1 -1
- package/SVF-doxygen/html/html/functions_s.html +3 -3
- 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_f.html +1 -1
- package/SVF-doxygen/html/html/functions_vars_v.html +2 -2
- package/SVF-doxygen/html/html/namespaceSVF_1_1SVFUtil.html +2 -2
- package/SVF-doxygen/html/html/namespaceSVF_1_1cppUtil.html +2 -2
- package/SVF-doxygen/html/html/search/all_1.js +4 -4
- package/SVF-doxygen/html/html/search/all_13.js +3 -3
- package/SVF-doxygen/html/html/search/all_16.js +3 -3
- package/SVF-doxygen/html/html/search/all_2.js +1 -1
- package/SVF-doxygen/html/html/search/all_6.js +2 -2
- package/SVF-doxygen/html/html/search/all_7.js +5 -5
- package/SVF-doxygen/html/html/search/all_9.js +1 -1
- package/SVF-doxygen/html/html/search/all_c.js +1 -1
- package/SVF-doxygen/html/html/search/all_e.js +1 -1
- package/SVF-doxygen/html/html/search/functions_0.js +4 -4
- package/SVF-doxygen/html/html/search/functions_10.js +2 -2
- 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 +5 -5
- package/SVF-doxygen/html/html/search/functions_8.js +1 -1
- package/SVF-doxygen/html/html/search/functions_a.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_16.js +2 -2
- package/SVF-doxygen/html/html/search/variables_2.js +1 -1
- package/SVF-doxygen/html/html/search/variables_6.js +1 -1
- package/SVF-doxygen/html/html/structstd_1_1hash_3_01SVF_1_1LocationSet_01_4.html +2 -2
- 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 +1 -1
- package/include/SVF-FE/SVFIRBuilder.h +2 -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 +1 -1
- package/lib/MemoryModel/SymbolTableInfo.cpp +3 -3
- package/lib/SVF-FE/CPPUtil.cpp +4 -4
- package/lib/SVF-FE/ICFGBuilder.cpp +1 -1
- package/lib/SVF-FE/LLVMUtil.cpp +1 -1
- package/lib/SVF-FE/SVFIRBuilder.cpp +9 -9
- package/lib/SVF-FE/SymbolTableBuilder.cpp +1 -1
- 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
|
@@ -109,8 +109,8 @@ struct std::hash< SVF::LocationSet ></h3>
|
|
|
109
109
|
</div><div class="memdoc">
|
|
110
110
|
|
|
111
111
|
<p class="definition">Definition at line <a class="el" href="LocationSet_8h_source.html#l00139">139</a> of file <a class="el" href="LocationSet_8h_source.html">LocationSet.h</a>.</p>
|
|
112
|
-
<div class="fragment"><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  {</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  <a class="code" href="structSVF_1_1Hash.html">SVF::Hash<std::pair<SVF::NodeID, SVF::NodeID></a>> h;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  std::hash<SVF::LocationSet::OffsetValueVec> v;</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <span class="keywordflow">return</span> h(std::make_pair(ls.<a class="code" href="classSVF_1_1LocationSet.html#
|
|
113
|
-
<div class="ttc" id="
|
|
112
|
+
<div class="fragment"><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  {</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  <a class="code" href="structSVF_1_1Hash.html">SVF::Hash<std::pair<SVF::NodeID, SVF::NodeID></a>> h;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  std::hash<SVF::LocationSet::OffsetValueVec> v;</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <span class="keywordflow">return</span> h(std::make_pair(ls.<a class="code" href="classSVF_1_1LocationSet.html#a63c5c8e03b35e0d0cea94137d309c853">accumulateConstantFieldIdx</a>(), v(ls.<a class="code" href="classSVF_1_1LocationSet.html#a5a5ca0b81da0b34ab426bc6a28ed346c">getOffsetValueVec</a>())));</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  }</div><div class="ttc" id="structSVF_1_1Hash_html"><div class="ttname"><a href="structSVF_1_1Hash.html">SVF::Hash</a></div><div class="ttdoc">provide extra hash function for std::pair handling </div><div class="ttdef"><b>Definition:</b> <a href="SVFBasicTypes_8h_source.html#l00052">SVFBasicTypes.h:52</a></div></div>
|
|
113
|
+
<div class="ttc" id="classSVF_1_1LocationSet_html_a63c5c8e03b35e0d0cea94137d309c853"><div class="ttname"><a href="classSVF_1_1LocationSet.html#a63c5c8e03b35e0d0cea94137d309c853">SVF::LocationSet::accumulateConstantFieldIdx</a></div><div class="ttdeci">s32_t accumulateConstantFieldIdx() const</div><div class="ttdoc">Get methods. </div><div class="ttdef"><b>Definition:</b> <a href="LocationSet_8h_source.html#l00090">LocationSet.h:90</a></div></div>
|
|
114
114
|
<div class="ttc" id="classSVF_1_1LocationSet_html_a5a5ca0b81da0b34ab426bc6a28ed346c"><div class="ttname"><a href="classSVF_1_1LocationSet.html#a5a5ca0b81da0b34ab426bc6a28ed346c">SVF::LocationSet::getOffsetValueVec</a></div><div class="ttdeci">const OffsetValueVec & getOffsetValueVec() const</div><div class="ttdef"><b>Definition:</b> <a href="LocationSet_8h_source.html#l00098">LocationSet.h:98</a></div></div>
|
|
115
115
|
</div><!-- fragment -->
|
|
116
116
|
</div>
|
package/include/Graphs/CHG.h
CHANGED
|
@@ -238,18 +238,18 @@ public:
|
|
|
238
238
|
void view();
|
|
239
239
|
void printCH();
|
|
240
240
|
|
|
241
|
-
inline
|
|
241
|
+
inline u32_t getVirtualFunctionID(const SVFFunction* vfn) const
|
|
242
242
|
{
|
|
243
|
-
Map<const SVFFunction*,
|
|
243
|
+
Map<const SVFFunction*, u32_t>::const_iterator it =
|
|
244
244
|
virtualFunctionToIDMap.find(vfn);
|
|
245
245
|
if (it != virtualFunctionToIDMap.end())
|
|
246
246
|
return it->second;
|
|
247
247
|
else
|
|
248
248
|
return -1;
|
|
249
249
|
}
|
|
250
|
-
inline const SVFFunction* getVirtualFunctionBasedonID(
|
|
250
|
+
inline const SVFFunction* getVirtualFunctionBasedonID(u32_t id) const
|
|
251
251
|
{
|
|
252
|
-
Map<const SVFFunction*,
|
|
252
|
+
Map<const SVFFunction*, u32_t>::const_iterator it, eit;
|
|
253
253
|
for (it = virtualFunctionToIDMap.begin(), eit =
|
|
254
254
|
virtualFunctionToIDMap.end(); it != eit; ++it)
|
|
255
255
|
{
|
|
@@ -309,7 +309,7 @@ public:
|
|
|
309
309
|
private:
|
|
310
310
|
SVFModule* svfMod;
|
|
311
311
|
u32_t classNum;
|
|
312
|
-
|
|
312
|
+
u32_t vfID;
|
|
313
313
|
double buildingCHGTime;
|
|
314
314
|
Map<std::string, CHNode *> classNameToNodeMap;
|
|
315
315
|
NameToCHNodesMap classNameToDescendantsMap;
|
|
@@ -318,7 +318,7 @@ private:
|
|
|
318
318
|
NameToCHNodesMap templateNameToInstancesMap;
|
|
319
319
|
CallSiteToCHNodesMap csToClassesMap;
|
|
320
320
|
|
|
321
|
-
Map<const SVFFunction*,
|
|
321
|
+
Map<const SVFFunction*, u32_t> virtualFunctionToIDMap;
|
|
322
322
|
CallSiteToVTableSetMap csToCHAVtblsMap;
|
|
323
323
|
CallSiteToVFunSetMap csToCHAVFnsMap;
|
|
324
324
|
};
|
package/include/Graphs/ICFG.h
CHANGED
|
@@ -128,7 +128,7 @@ protected:
|
|
|
128
128
|
/// Add control-flow edges for top level pointers
|
|
129
129
|
//@{
|
|
130
130
|
ICFGEdge* addIntraEdge(ICFGNode* srcNode, ICFGNode* dstNode);
|
|
131
|
-
ICFGEdge* addConditionalIntraEdge(ICFGNode* srcNode, ICFGNode* dstNode, const Value* condition,
|
|
131
|
+
ICFGEdge* addConditionalIntraEdge(ICFGNode* srcNode, ICFGNode* dstNode, const Value* condition, s32_t branchCondVal);
|
|
132
132
|
ICFGEdge* addCallEdge(ICFGNode* srcNode, ICFGNode* dstNode, const Instruction* cs);
|
|
133
133
|
ICFGEdge* addRetEdge(ICFGNode* srcNode, ICFGNode* dstNode, const Instruction* cs);
|
|
134
134
|
//@}
|
|
@@ -138,12 +138,12 @@ public:
|
|
|
138
138
|
return conditionVar;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
const
|
|
141
|
+
const s32_t getSuccessorCondValue() const{
|
|
142
142
|
assert(getCondition() && "this is not a conditional branch edge");
|
|
143
143
|
return branchCondVal;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
void setBranchCondition(const Value* c,
|
|
146
|
+
void setBranchCondition(const Value* c, s32_t bVal){
|
|
147
147
|
conditionVar = c;
|
|
148
148
|
branchCondVal = bVal;
|
|
149
149
|
}
|
|
@@ -156,7 +156,7 @@ private:
|
|
|
156
156
|
/// e.g., Inst1: br %cmp label 0, label 1, Inst2 is label 0 and Inst 3 is label 1;
|
|
157
157
|
/// for edge between Inst1 and Inst 2, the first element is %cmp and second element is 0
|
|
158
158
|
const Value* conditionVar;
|
|
159
|
-
|
|
159
|
+
s32_t branchCondVal;
|
|
160
160
|
};
|
|
161
161
|
|
|
162
162
|
/*!
|
|
@@ -57,7 +57,7 @@ public:
|
|
|
57
57
|
typedef std::vector<std::pair<const Value*, const Type*> > OffsetValueVec;
|
|
58
58
|
|
|
59
59
|
/// Constructor
|
|
60
|
-
LocationSet(
|
|
60
|
+
LocationSet(s32_t o = 0) : fldIdx(o)
|
|
61
61
|
{}
|
|
62
62
|
|
|
63
63
|
/// Copy Constructor
|
|
@@ -87,11 +87,11 @@ public:
|
|
|
87
87
|
|
|
88
88
|
/// Get methods
|
|
89
89
|
//@{
|
|
90
|
-
inline
|
|
90
|
+
inline s32_t accumulateConstantFieldIdx() const
|
|
91
91
|
{
|
|
92
92
|
return fldIdx;
|
|
93
93
|
}
|
|
94
|
-
inline void setFldIdx(
|
|
94
|
+
inline void setFldIdx(s32_t idx)
|
|
95
95
|
{
|
|
96
96
|
fldIdx = idx;
|
|
97
97
|
}
|
|
@@ -102,7 +102,7 @@ public:
|
|
|
102
102
|
//@}
|
|
103
103
|
|
|
104
104
|
/// Return accumulated constant offset given OffsetValueVec
|
|
105
|
-
|
|
105
|
+
s32_t accumulateConstantOffset() const;
|
|
106
106
|
|
|
107
107
|
/// Return element number of a type.
|
|
108
108
|
u32_t getElementNum(const Type* type) const;
|
|
@@ -129,7 +129,7 @@ private:
|
|
|
129
129
|
/// Compute all possible locations according to offset and number-stride pairs.
|
|
130
130
|
NodeBS computeAllLocations() const;
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
s32_t fldIdx; ///< Accumulated Constant Offsets
|
|
133
133
|
OffsetValueVec offsetValues; ///< a vector of actual offset in the form of Values
|
|
134
134
|
};
|
|
135
135
|
|
|
@@ -63,7 +63,7 @@ public:
|
|
|
63
63
|
typedef Map<const SVFFunction*,SVFStmtSet> FunToPAGEdgeSetMap;
|
|
64
64
|
typedef Map<const ICFGNode*,SVFStmtList> ICFGNode2SVFStmtsMap;
|
|
65
65
|
typedef Map<NodeID, NodeID> NodeToNodeMap;
|
|
66
|
-
typedef std::pair<NodeID,
|
|
66
|
+
typedef std::pair<NodeID, s32_t> NodeOffset;
|
|
67
67
|
typedef std::pair<NodeID, LocationSet> NodeLocationSet;
|
|
68
68
|
typedef Map<NodeOffset,NodeID> NodeOffsetMap;
|
|
69
69
|
typedef Map<NodeLocationSet,NodeID> NodeLocationSetMap;
|
|
@@ -445,12 +445,12 @@ public:
|
|
|
445
445
|
return getLocationSet().isConstantOffset();
|
|
446
446
|
}
|
|
447
447
|
/// Return accumulated constant offset (when accessing array or struct) if this offset is a constant.
|
|
448
|
-
inline
|
|
448
|
+
inline s32_t accumulateConstantOffset() const
|
|
449
449
|
{
|
|
450
450
|
return getLocationSet().accumulateConstantOffset();
|
|
451
451
|
}
|
|
452
452
|
/// Field index of the gep statement if it access the field of a struct
|
|
453
|
-
inline
|
|
453
|
+
inline s32_t getConstantFieldIdx() const
|
|
454
454
|
{
|
|
455
455
|
assert(isVariantFieldGep()==false && "Can't retrieve the LocationSet if using a variable field index (pointer arithmetic) for struct field access ");
|
|
456
456
|
return getLocationSet().accumulateConstantFieldIdx();
|
|
@@ -921,7 +921,7 @@ public:
|
|
|
921
921
|
class BranchStmt: public SVFStmt
|
|
922
922
|
{
|
|
923
923
|
public:
|
|
924
|
-
typedef std::vector<std::pair<const ICFGNode*,
|
|
924
|
+
typedef std::vector<std::pair<const ICFGNode*, s32_t> > SuccAndCondPairVec;
|
|
925
925
|
private:
|
|
926
926
|
BranchStmt(); ///< place holder
|
|
927
927
|
BranchStmt(const BranchStmt &); ///< place holder
|
|
@@ -987,7 +987,7 @@ public:
|
|
|
987
987
|
const ICFGNode* getSuccessor (u32_t i) const{
|
|
988
988
|
return successors.at(i).first;
|
|
989
989
|
}
|
|
990
|
-
|
|
990
|
+
s32_t getSuccessorCondValue (u32_t i) const{
|
|
991
991
|
return successors.at(i).second;
|
|
992
992
|
}
|
|
993
993
|
//@}
|
|
@@ -413,7 +413,7 @@ public:
|
|
|
413
413
|
}
|
|
414
414
|
|
|
415
415
|
/// offset of the base value variable
|
|
416
|
-
inline
|
|
416
|
+
inline s32_t getConstantFieldIdx() const
|
|
417
417
|
{
|
|
418
418
|
return ls.accumulateConstantFieldIdx();
|
|
419
419
|
}
|
|
@@ -483,7 +483,7 @@ public:
|
|
|
483
483
|
}
|
|
484
484
|
|
|
485
485
|
/// offset of the mem object
|
|
486
|
-
inline
|
|
486
|
+
inline s32_t getConstantFieldIdx() const
|
|
487
487
|
{
|
|
488
488
|
return ls.accumulateConstantFieldIdx();
|
|
489
489
|
}
|
|
@@ -350,7 +350,7 @@ public:
|
|
|
350
350
|
/// Number of flattenned elements of an array or struct
|
|
351
351
|
u32_t getNumOfFlattenElements(const Type *T);
|
|
352
352
|
/// Flatterned element idx of an array or struct by considering stride
|
|
353
|
-
u32_t getFlattenedElemIdx(const Type *T,
|
|
353
|
+
u32_t getFlattenedElemIdx(const Type *T, u32_t origId);
|
|
354
354
|
|
|
355
355
|
/// struct A { int id; int salary; }; struct B { char name[20]; struct A a;} B b;
|
|
356
356
|
/// OriginalElemType of b with field_idx 1 : Struct A
|
|
@@ -74,7 +74,7 @@ public:
|
|
|
74
74
|
//@{
|
|
75
75
|
void initialiseNodes();
|
|
76
76
|
void addEdge(NodeID src, NodeID dst, SVFStmt::PEDGEK kind,
|
|
77
|
-
|
|
77
|
+
s32_t offset = 0, Instruction* cs = nullptr);
|
|
78
78
|
// @}
|
|
79
79
|
|
|
80
80
|
/// Sanity check for SVFIR
|
|
@@ -220,7 +220,7 @@ protected:
|
|
|
220
220
|
void processCE(const Value *val);
|
|
221
221
|
|
|
222
222
|
/// Infer field index from byteoffset.
|
|
223
|
-
u32_t inferFieldIdxFromByteOffset(const llvm::GEPOperator* gepOp, DataLayout *dl, LocationSet& ls,
|
|
223
|
+
u32_t inferFieldIdxFromByteOffset(const llvm::GEPOperator* gepOp, DataLayout *dl, LocationSet& ls, s32_t idx);
|
|
224
224
|
|
|
225
225
|
/// Compute offset of a gep instruction or gep constant expression
|
|
226
226
|
bool computeGepOffset(const User *V, LocationSet& ls);
|
|
@@ -85,7 +85,7 @@ private:
|
|
|
85
85
|
{
|
|
86
86
|
std::string label = it->getName().str();
|
|
87
87
|
std::string toErase = "gepnode-";
|
|
88
|
-
SVF::
|
|
88
|
+
SVF::s32_t pos = label.find(toErase);
|
|
89
89
|
if (pos == std::string::npos)
|
|
90
90
|
{
|
|
91
91
|
continue;
|
|
@@ -96,7 +96,7 @@ private:
|
|
|
96
96
|
auto mdNode = it->getOperand(0);
|
|
97
97
|
|
|
98
98
|
SVF::NodeID baseNodeId = std::stoi(llvm::cast<llvm::MDString>(mdNode->getOperand(0))->getString().str());
|
|
99
|
-
SVF::
|
|
99
|
+
SVF::s32_t locationSetOffset = std::stoi(llvm::cast<llvm::MDString>(mdNode->getOperand(1))->getString().str());
|
|
100
100
|
|
|
101
101
|
LocationSet locationSet = LocationSet(locationSetOffset);
|
|
102
102
|
SVF::NodeID gepnodeId = pag->getGepObjVar(baseNodeId, locationSet);
|
|
@@ -149,7 +149,7 @@ public:
|
|
|
149
149
|
protected:
|
|
150
150
|
void initialize();
|
|
151
151
|
void PWCDetect();
|
|
152
|
-
void fieldExpand(NodeSet& initials,
|
|
152
|
+
void fieldExpand(NodeSet& initials, s32_t offset, NodeBS& strides, PointsTo& expandPts);
|
|
153
153
|
bool processGepPts(PointsTo& pts, const GepCGEdge* edge);
|
|
154
154
|
bool mergeSrcToTgt(NodeID nodeId, NodeID newRepId);
|
|
155
155
|
|
package/include/WPA/CSC.h
CHANGED
package/lib/Graphs/ICFG.cpp
CHANGED
|
@@ -352,7 +352,7 @@ ICFGEdge* ICFG::addIntraEdge(ICFGNode* srcNode, ICFGNode* dstNode)
|
|
|
352
352
|
/*!
|
|
353
353
|
* Add conditional intraprocedural edges between two nodes
|
|
354
354
|
*/
|
|
355
|
-
ICFGEdge* ICFG::addConditionalIntraEdge(ICFGNode* srcNode, ICFGNode* dstNode, const Value* condition,
|
|
355
|
+
ICFGEdge* ICFG::addConditionalIntraEdge(ICFGNode* srcNode, ICFGNode* dstNode, const Value* condition, s32_t branchCondVal){
|
|
356
356
|
|
|
357
357
|
checkIntraEdgeParents(srcNode, dstNode);
|
|
358
358
|
if(ICFGEdge* edge = hasIntraICFGEdge(srcNode,dstNode, ICFGEdge::IntraCF))
|
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
|
|
@@ -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
|
{
|
|
@@ -200,7 +200,7 @@ void SymbolTableInfo::collectStructInfo(const StructType *sty)
|
|
|
200
200
|
sty->element_end(); it != ie; ++it)
|
|
201
201
|
{
|
|
202
202
|
const Type *et = *it;
|
|
203
|
-
/// offset with int_32 (
|
|
203
|
+
/// offset with int_32 (s32_t) is large enough and will not cause overflow
|
|
204
204
|
stinfo->addFldWithType(nf, et, strideOffset);
|
|
205
205
|
|
|
206
206
|
if (SVFUtil::isa<StructType>(et) || SVFUtil::isa<ArrayType>(et))
|
|
@@ -269,7 +269,7 @@ LocationSet SymbolTableInfo::getModulusOffset(const MemObj* obj, const LocationS
|
|
|
269
269
|
/// of current struct. Make the offset positive so we can still get a node within current
|
|
270
270
|
/// struct to represent this obj.
|
|
271
271
|
|
|
272
|
-
|
|
272
|
+
s32_t offset = ls.accumulateConstantFieldIdx();
|
|
273
273
|
if(offset < 0)
|
|
274
274
|
{
|
|
275
275
|
writeWrnMsg("try to create a gep node with negative offset.");
|
|
@@ -405,7 +405,7 @@ u32_t SymbolTableInfo::getNumOfFlattenElements(const Type *T)
|
|
|
405
405
|
}
|
|
406
406
|
|
|
407
407
|
/// Flatterned offset information of a struct or an array including its array fields
|
|
408
|
-
u32_t SymbolTableInfo::getFlattenedElemIdx(const Type *T,
|
|
408
|
+
u32_t SymbolTableInfo::getFlattenedElemIdx(const Type *T, u32_t origId)
|
|
409
409
|
{
|
|
410
410
|
if(Options::ModelArrays){
|
|
411
411
|
std::vector<u32_t>& so = getStructInfoIter(T)->second->getFlattenedElemIdxVec();
|
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
|
@@ -371,7 +371,7 @@ void SVFUtil::processArguments(int argc, char **argv, int &arg_num, char **arg_v
|
|
|
371
371
|
std::vector<std::string> &moduleNameVec)
|
|
372
372
|
{
|
|
373
373
|
bool first_ir_file = true;
|
|
374
|
-
for (
|
|
374
|
+
for (u32_t i = 0; i < argc; ++i)
|
|
375
375
|
{
|
|
376
376
|
std::string argument(argv[i]);
|
|
377
377
|
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;
|
|
@@ -609,7 +609,7 @@ const Value* SymbolTableBuilder::getUniqueUseViaCastInst(const Value* val){
|
|
|
609
609
|
*/
|
|
610
610
|
void SymbolTableBuilder::initTypeInfo(ObjTypeInfo* typeinfo, const Value* val){
|
|
611
611
|
|
|
612
|
-
|
|
612
|
+
u32_t objSize = 1;
|
|
613
613
|
// Global variable
|
|
614
614
|
if (SVFUtil::isa<Function>(val))
|
|
615
615
|
{
|
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
|