svf-lib 1.0.906 → 1.0.907
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-osx/Release-build/lib/CUDD/libCudd.a +0 -0
- package/SVF-osx/Release-build/lib/libSvf.a +0 -0
- package/SVF-osx/include/Graphs/CHG.h +6 -6
- package/SVF-osx/include/Graphs/ConsGEdge.h +1 -1
- package/SVF-osx/include/Graphs/ICFG.h +1 -1
- package/SVF-osx/include/Graphs/ICFGEdge.h +3 -3
- package/SVF-osx/include/MemoryModel/LocationSet.h +5 -5
- package/SVF-osx/include/MemoryModel/PAGBuilderFromFile.h +1 -1
- package/SVF-osx/include/MemoryModel/SVFIR.h +1 -1
- package/SVF-osx/include/MemoryModel/SVFStatements.h +4 -4
- package/SVF-osx/include/MemoryModel/SVFVariables.h +2 -2
- package/SVF-osx/include/MemoryModel/SymbolTableInfo.h +1 -1
- package/SVF-osx/include/SVF-FE/SVFIRBuilder.h +2 -2
- package/SVF-osx/include/Util/IRAnnotator.h +2 -2
- package/SVF-osx/include/WPA/AndersenSFR.h +1 -1
- package/SVF-osx/include/WPA/CSC.h +1 -1
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
@@ -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
|
};
|
|
@@ -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
|
|