svf-lib 1.0.764 → 1.0.768
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-linux/Release-build/lib/libSvf.a +0 -0
- package/SVF-linux/include/Graphs/ConsG.h +1 -1
- package/SVF-linux/include/Graphs/ConsGEdge.h +2 -2
- package/SVF-linux/include/Graphs/VFG.h +4 -4
- package/SVF-linux/include/MemoryModel/LocationSet.h +3 -3
- package/SVF-linux/include/MemoryModel/SVFIR.h +1 -1
- package/SVF-linux/include/MemoryModel/SVFStatements.h +378 -308
- package/SVF-linux/include/MemoryModel/SVFVariables.h +9 -9
- package/SVF-linux/include/SVF-FE/DCHG.h +3 -3
- package/SVF-linux/include/SVF-FE/SVFIRBuilder.h +2 -2
- package/SVF-linux/include/Util/IRAnnotator.h +1 -1
- 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/ConsG.h +1 -1
- package/SVF-osx/include/Graphs/ConsGEdge.h +2 -2
- package/SVF-osx/include/Graphs/VFG.h +4 -4
- package/SVF-osx/include/MemoryModel/LocationSet.h +3 -3
- package/SVF-osx/include/MemoryModel/SVFIR.h +1 -1
- package/SVF-osx/include/MemoryModel/SVFStatements.h +378 -308
- package/SVF-osx/include/MemoryModel/SVFVariables.h +9 -9
- package/SVF-osx/include/SVF-FE/DCHG.h +3 -3
- package/SVF-osx/include/SVF-FE/SVFIRBuilder.h +2 -2
- package/SVF-osx/include/Util/IRAnnotator.h +1 -1
- package/package.json +1 -1
|
@@ -417,17 +417,17 @@ public:
|
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
/// offset of the base value variable
|
|
420
|
-
inline u32_t
|
|
420
|
+
inline u32_t getFieldOffset() const
|
|
421
421
|
{
|
|
422
|
-
return ls.
|
|
422
|
+
return ls.accumulateConstantFieldIdx();
|
|
423
423
|
}
|
|
424
424
|
|
|
425
425
|
/// Return name of a LLVM value
|
|
426
426
|
inline const std::string getValueName() const
|
|
427
427
|
{
|
|
428
428
|
if (value && value->hasName())
|
|
429
|
-
return value->getName().str() + "_" + llvm::utostr(
|
|
430
|
-
return "offset_" + llvm::utostr(
|
|
429
|
+
return value->getName().str() + "_" + llvm::utostr(getFieldOffset());
|
|
430
|
+
return "offset_" + llvm::utostr(getFieldOffset());
|
|
431
431
|
}
|
|
432
432
|
|
|
433
433
|
inline const Type* getType() const
|
|
@@ -492,9 +492,9 @@ public:
|
|
|
492
492
|
}
|
|
493
493
|
|
|
494
494
|
/// offset of the mem object
|
|
495
|
-
inline u32_t
|
|
495
|
+
inline u32_t getFieldOffset() const
|
|
496
496
|
{
|
|
497
|
-
return ls.
|
|
497
|
+
return ls.accumulateConstantFieldIdx();
|
|
498
498
|
}
|
|
499
499
|
|
|
500
500
|
/// Set the base object from which this GEP node came from.
|
|
@@ -512,15 +512,15 @@ public:
|
|
|
512
512
|
/// Return the type of this gep object
|
|
513
513
|
inline virtual const Type* getType() const
|
|
514
514
|
{
|
|
515
|
-
return SymbolTableInfo::SymbolInfo()->getOriginalFieldType(mem->getType(), ls.
|
|
515
|
+
return SymbolTableInfo::SymbolInfo()->getOriginalFieldType(mem->getType(), ls.accumulateConstantFieldIdx());
|
|
516
516
|
}
|
|
517
517
|
|
|
518
518
|
/// Return name of a LLVM value
|
|
519
519
|
inline const std::string getValueName() const
|
|
520
520
|
{
|
|
521
521
|
if (value && value->hasName())
|
|
522
|
-
return value->getName().str() + "_" + llvm::itostr(ls.
|
|
523
|
-
return "offset_" + llvm::itostr(ls.
|
|
522
|
+
return value->getName().str() + "_" + llvm::itostr(ls.accumulateConstantFieldIdx());
|
|
523
|
+
return "offset_" + llvm::itostr(ls.accumulateConstantFieldIdx());
|
|
524
524
|
}
|
|
525
525
|
|
|
526
526
|
virtual const std::string toString() const;
|
|
@@ -46,18 +46,18 @@ public:
|
|
|
46
46
|
{
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
u32_t getFieldOffset(void) const
|
|
50
50
|
{
|
|
51
51
|
return offset;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
void setOffset(
|
|
54
|
+
void setOffset(u32_t offset)
|
|
55
55
|
{
|
|
56
56
|
this->offset = offset;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
private:
|
|
60
|
-
|
|
60
|
+
u32_t offset;
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
class DCHNode : public GenericNode<DCHNode, DCHEdge>
|
|
@@ -381,9 +381,9 @@ public:
|
|
|
381
381
|
return edge;
|
|
382
382
|
}
|
|
383
383
|
/// Add Variant(Gep) edge
|
|
384
|
-
inline VariantGepStmt* addVariantGepEdge(NodeID src, NodeID dst)
|
|
384
|
+
inline VariantGepStmt* addVariantGepEdge(NodeID src, NodeID dst, const LocationSet& ls)
|
|
385
385
|
{
|
|
386
|
-
VariantGepStmt *edge = pag->addVariantGepStmt(src, dst);
|
|
386
|
+
VariantGepStmt *edge = pag->addVariantGepStmt(src, dst, ls);
|
|
387
387
|
setCurrentBBAndValueForPAGEdge(edge);
|
|
388
388
|
return edge;
|
|
389
389
|
}
|
|
@@ -64,7 +64,7 @@ private:
|
|
|
64
64
|
void writePAGgepNode(SVF::NodeID nodeId, GepObjVar* gepNode)
|
|
65
65
|
{
|
|
66
66
|
auto baseNodeId = gepNode->getBaseNode();
|
|
67
|
-
auto locationSetOffset = gepNode->
|
|
67
|
+
auto locationSetOffset = gepNode->getFieldOffset();
|
|
68
68
|
|
|
69
69
|
LLVMContext &context = mainModule->getContext();
|
|
70
70
|
llvm::SmallVector<llvm::Metadata *, 32> operands;
|
|
Binary file
|
|
Binary file
|
|
@@ -291,7 +291,7 @@ public:
|
|
|
291
291
|
inline bool isZeroOffsettedGepCGEdge(ConstraintEdge *edge) const
|
|
292
292
|
{
|
|
293
293
|
if (NormalGepCGEdge *normalGepCGEdge = SVFUtil::dyn_cast<NormalGepCGEdge>(edge))
|
|
294
|
-
if (0 == normalGepCGEdge->
|
|
294
|
+
if (0 == normalGepCGEdge->getFieldOffset())
|
|
295
295
|
return true;
|
|
296
296
|
return false;
|
|
297
297
|
}
|
|
@@ -304,9 +304,9 @@ public:
|
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
/// Get location set of the gep edge
|
|
307
|
-
inline Size_t
|
|
307
|
+
inline Size_t getFieldOffset() const
|
|
308
308
|
{
|
|
309
|
-
return ls.
|
|
309
|
+
return ls.accumulateConstantFieldIdx();
|
|
310
310
|
}
|
|
311
311
|
};
|
|
312
312
|
|
|
@@ -487,28 +487,28 @@ protected:
|
|
|
487
487
|
{
|
|
488
488
|
AddrVFGNode* sNode = new AddrVFGNode(totalVFGNode++,addr);
|
|
489
489
|
addStmtVFGNode(sNode, addr);
|
|
490
|
-
setDef(addr->
|
|
490
|
+
setDef(addr->getLHSVar(),sNode);
|
|
491
491
|
}
|
|
492
492
|
/// Add a Copy VFG node
|
|
493
493
|
inline void addCopyVFGNode(const CopyStmt* copy)
|
|
494
494
|
{
|
|
495
495
|
CopyVFGNode* sNode = new CopyVFGNode(totalVFGNode++,copy);
|
|
496
496
|
addStmtVFGNode(sNode, copy);
|
|
497
|
-
setDef(copy->
|
|
497
|
+
setDef(copy->getLHSVar(),sNode);
|
|
498
498
|
}
|
|
499
499
|
/// Add a Gep VFG node
|
|
500
500
|
inline void addGepVFGNode(const GepStmt* gep)
|
|
501
501
|
{
|
|
502
502
|
GepVFGNode* sNode = new GepVFGNode(totalVFGNode++,gep);
|
|
503
503
|
addStmtVFGNode(sNode, gep);
|
|
504
|
-
setDef(gep->
|
|
504
|
+
setDef(gep->getLHSVar(),sNode);
|
|
505
505
|
}
|
|
506
506
|
/// Add a Load VFG node
|
|
507
507
|
void addLoadVFGNode(const LoadStmt* load)
|
|
508
508
|
{
|
|
509
509
|
LoadVFGNode* sNode = new LoadVFGNode(totalVFGNode++,load);
|
|
510
510
|
addStmtVFGNode(sNode, load);
|
|
511
|
-
setDef(load->
|
|
511
|
+
setDef(load->getLHSVar(),sNode);
|
|
512
512
|
}
|
|
513
513
|
/// Add a Store VFG node,
|
|
514
514
|
/// To be noted store does not create a new pointer, we do not set def for any SVFIR node
|
|
@@ -104,7 +104,7 @@ public:
|
|
|
104
104
|
inline LocationSet operator+ (const LocationSet& rhs) const
|
|
105
105
|
{
|
|
106
106
|
LocationSet ls(rhs);
|
|
107
|
-
ls.fldIdx +=
|
|
107
|
+
ls.fldIdx += accumulateConstantFieldIdx();
|
|
108
108
|
OffsetValueVec::const_iterator it = getOffsetValueVec().begin();
|
|
109
109
|
OffsetValueVec::const_iterator eit = getOffsetValueVec().end();
|
|
110
110
|
for (; it != eit; ++it)
|
|
@@ -151,7 +151,7 @@ public:
|
|
|
151
151
|
|
|
152
152
|
/// Get methods
|
|
153
153
|
//@{
|
|
154
|
-
inline Size_t
|
|
154
|
+
inline Size_t accumulateConstantFieldIdx() const
|
|
155
155
|
{
|
|
156
156
|
return fldIdx;
|
|
157
157
|
}
|
|
@@ -203,7 +203,7 @@ template <> struct std::hash<SVF::LocationSet> {
|
|
|
203
203
|
size_t operator()(const SVF::LocationSet &ls) const {
|
|
204
204
|
SVF::Hash<std::pair<SVF::NodeID, SVF::NodeID>> h;
|
|
205
205
|
std::hash<SVF::LocationSet::OffsetValueVec> v;
|
|
206
|
-
return h(std::make_pair(ls.
|
|
206
|
+
return h(std::make_pair(ls.accumulateConstantFieldIdx(), v(ls.getOffsetValueVec())));
|
|
207
207
|
}
|
|
208
208
|
};
|
|
209
209
|
|
|
@@ -651,7 +651,7 @@ private:
|
|
|
651
651
|
/// Add Offset(Gep) edge
|
|
652
652
|
NormalGepStmt* addNormalGepStmt(NodeID src, NodeID dst, const LocationSet& ls);
|
|
653
653
|
/// Add Variant(Gep) edge
|
|
654
|
-
VariantGepStmt* addVariantGepStmt(NodeID src, NodeID dst);
|
|
654
|
+
VariantGepStmt* addVariantGepStmt(NodeID src, NodeID dst, const LocationSet& ls);
|
|
655
655
|
/// Add Thread fork edge for parameter passing
|
|
656
656
|
TDForkPE* addThreadForkPE(NodeID src, NodeID dst, const CallBlockNode* cs);
|
|
657
657
|
/// Add Thread join edge for parameter passing
|