svf-lib 1.0.1722 → 1.0.1724
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/svf/libSvfCore.a +0 -0
- package/SVF-osx/Release-build/svf/libSvfCore.a +0 -0
- package/SVF-osx/Release-build/svf-llvm/libSvfLLVM.a +0 -0
- package/SVF-osx/svf/include/AbstractExecution/IntervalValue.h +3 -3
- package/SVF-osx/svf/include/AbstractExecution/SVFIR2ItvExeState.h +5 -5
- package/SVF-osx/svf/include/MemoryModel/AccessPath.h +6 -5
- package/SVF-osx/svf/include/SVFIR/SVFStatements.h +3 -1
- package/SVF-osx/svf/include/SVFIR/SVFType.h +18 -12
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -659,9 +659,9 @@ inline IntervalValue operator<(const IntervalValue &lhs, const IntervalValue &rh
|
|
|
659
659
|
}
|
|
660
660
|
// Return [0,0] means lhs is totally impossible to be less than rhs
|
|
661
661
|
// i.e., lhs is totally greater than or equal to rhs
|
|
662
|
-
// When lhs.
|
|
663
|
-
// lhs.
|
|
664
|
-
else if (
|
|
662
|
+
// When lhs.lb >= rhs.ub, e.g., lhs:[4,5] rhs:[3,4]
|
|
663
|
+
// lhs.lb(4) >= rhs.ub(4)
|
|
664
|
+
else if (lhs.lb().geq(rhs.ub()))
|
|
665
665
|
{
|
|
666
666
|
return IntervalValue(0, 0);
|
|
667
667
|
}
|
|
@@ -74,20 +74,20 @@ public:
|
|
|
74
74
|
VAddrs getGepObjAddress(u32_t pointer, APOffset offset);
|
|
75
75
|
|
|
76
76
|
/// Return the byte offset from one gep param offset
|
|
77
|
-
|
|
77
|
+
IntervalValue getByteOffsetfromGepTypePair(const AccessPath::IdxVarAndGepTypePair& gep_pair, const GepStmt *gep);
|
|
78
78
|
|
|
79
79
|
/// Return the Index offset from one gep param offset
|
|
80
|
-
|
|
80
|
+
IntervalValue getItvOfFlattenedElemIndexFromGepTypePair(const AccessPath::IdxVarAndGepTypePair& gep_pair, const GepStmt *gep);
|
|
81
81
|
|
|
82
82
|
/// Return the byte offset expression of a GepStmt
|
|
83
83
|
/// elemBytesize is the element byte size of an static alloc or heap alloc array
|
|
84
84
|
/// e.g. GepStmt* gep = [i32*10], x, and x is [0,3]
|
|
85
|
-
/// std::pair<s32_t, s32_t> byteOffset =
|
|
85
|
+
/// std::pair<s32_t, s32_t> byteOffset = getByteOffset(gep);
|
|
86
86
|
/// byteOffset should be [0, 12] since i32 is 4 bytes.
|
|
87
|
-
|
|
87
|
+
IntervalValue getByteOffset(const GepStmt *gep);
|
|
88
88
|
|
|
89
89
|
/// Return the offset expression of a GepStmt
|
|
90
|
-
|
|
90
|
+
IntervalValue getItvOfFlattenedElemIndex(const GepStmt *gep);
|
|
91
91
|
|
|
92
92
|
static z3::context &getContext()
|
|
93
93
|
{
|
|
@@ -57,8 +57,8 @@ public:
|
|
|
57
57
|
NonOverlap, Overlap, Subset, Superset, Same
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
typedef std::pair<const SVFVar*, const SVFType*>
|
|
61
|
-
typedef std::vector<
|
|
60
|
+
typedef std::pair<const SVFVar*, const SVFType*> IdxVarAndGepTypePair;
|
|
61
|
+
typedef std::vector<IdxVarAndGepTypePair> IdxVarAndGepTypePairs;
|
|
62
62
|
|
|
63
63
|
/// Constructor
|
|
64
64
|
AccessPath(APOffset o = 0) : fldIdx(o) {}
|
|
@@ -99,7 +99,7 @@ public:
|
|
|
99
99
|
{
|
|
100
100
|
fldIdx = idx;
|
|
101
101
|
}
|
|
102
|
-
inline const
|
|
102
|
+
inline const IdxVarAndGepTypePairs& getOffsetVarAndGepTypePairVec() const
|
|
103
103
|
{
|
|
104
104
|
return offsetVarAndGepTypePairs;
|
|
105
105
|
}
|
|
@@ -158,7 +158,8 @@ private:
|
|
|
158
158
|
NodeBS computeAllLocations() const;
|
|
159
159
|
|
|
160
160
|
APOffset fldIdx; ///< Accumulated Constant Offsets
|
|
161
|
-
|
|
161
|
+
IdxVarAndGepTypePairs
|
|
162
|
+
offsetVarAndGepTypePairs; ///< a vector of actual offset in the form of <SVF Var, iterator type>s
|
|
162
163
|
};
|
|
163
164
|
|
|
164
165
|
} // End namespace SVF
|
|
@@ -168,7 +169,7 @@ template <> struct std::hash<SVF::AccessPath>
|
|
|
168
169
|
size_t operator()(const SVF::AccessPath &ap) const
|
|
169
170
|
{
|
|
170
171
|
SVF::Hash<std::pair<SVF::NodeID, SVF::NodeID>> h;
|
|
171
|
-
std::hash<SVF::AccessPath::
|
|
172
|
+
std::hash<SVF::AccessPath::IdxVarAndGepTypePairs> v;
|
|
172
173
|
return h(std::make_pair(ap.getConstantFieldIdx(),
|
|
173
174
|
v(ap.getOffsetVarAndGepTypePairVec())));
|
|
174
175
|
}
|
|
@@ -341,6 +341,7 @@ public:
|
|
|
341
341
|
AddrStmt(SVFVar* s, SVFVar* d) : AssignStmt(s, d, SVFStmt::Addr) {}
|
|
342
342
|
|
|
343
343
|
virtual const std::string toString() const override;
|
|
344
|
+
|
|
344
345
|
};
|
|
345
346
|
|
|
346
347
|
/*!
|
|
@@ -490,7 +491,8 @@ public:
|
|
|
490
491
|
{
|
|
491
492
|
return ap;
|
|
492
493
|
}
|
|
493
|
-
inline const AccessPath::
|
|
494
|
+
inline const AccessPath::IdxVarAndGepTypePairs
|
|
495
|
+
getOffsetVarAndGepTypePairVec() const
|
|
494
496
|
{
|
|
495
497
|
return getAccessPath().getOffsetVarAndGepTypePairVec();
|
|
496
498
|
}
|
|
@@ -264,12 +264,13 @@ private:
|
|
|
264
264
|
getPointerToTy; /// Return a pointer to the current type
|
|
265
265
|
StInfo* typeinfo; ///< SVF's TypeInfo
|
|
266
266
|
bool isSingleValTy; ///< The type represents a single value, not struct or
|
|
267
|
+
u32_t byteSize; ///< LLVM Byte Size
|
|
267
268
|
///< array
|
|
268
269
|
|
|
269
270
|
protected:
|
|
270
|
-
SVFType(bool svt, SVFTyKind k)
|
|
271
|
+
SVFType(bool svt, SVFTyKind k, u32_t Sz)
|
|
271
272
|
: kind(k), getPointerToTy(nullptr), typeinfo(nullptr),
|
|
272
|
-
isSingleValTy(svt)
|
|
273
|
+
isSingleValTy(svt), byteSize(Sz)
|
|
273
274
|
{
|
|
274
275
|
}
|
|
275
276
|
|
|
@@ -299,8 +300,6 @@ public:
|
|
|
299
300
|
return getPointerToTy;
|
|
300
301
|
}
|
|
301
302
|
|
|
302
|
-
u32_t getLLVMByteSize() const;
|
|
303
|
-
|
|
304
303
|
inline void setTypeInfo(StInfo* ti)
|
|
305
304
|
{
|
|
306
305
|
typeinfo = ti;
|
|
@@ -318,6 +317,13 @@ public:
|
|
|
318
317
|
return typeinfo;
|
|
319
318
|
}
|
|
320
319
|
|
|
320
|
+
/// if Type is not sized, byteSize is 0
|
|
321
|
+
/// if Type is sized, byteSize is the LLVM Byte Size.
|
|
322
|
+
inline u32_t getByteSize() const
|
|
323
|
+
{
|
|
324
|
+
return byteSize;
|
|
325
|
+
}
|
|
326
|
+
|
|
321
327
|
inline bool isPointerTy() const
|
|
322
328
|
{
|
|
323
329
|
return kind == SVFPointerTy;
|
|
@@ -350,8 +356,8 @@ private:
|
|
|
350
356
|
const SVFType* ptrElementType;
|
|
351
357
|
|
|
352
358
|
public:
|
|
353
|
-
SVFPointerType()
|
|
354
|
-
: SVFType(true, SVFPointerTy), ptrElementType(nullptr)
|
|
359
|
+
SVFPointerType(u32_t byteSize)
|
|
360
|
+
: SVFType(true, SVFPointerTy, byteSize), ptrElementType(nullptr)
|
|
355
361
|
{
|
|
356
362
|
}
|
|
357
363
|
|
|
@@ -382,7 +388,7 @@ private:
|
|
|
382
388
|
short signAndWidth; ///< For printing
|
|
383
389
|
|
|
384
390
|
public:
|
|
385
|
-
SVFIntegerType() : SVFType(true, SVFIntegerTy) {}
|
|
391
|
+
SVFIntegerType(u32_t byteSize) : SVFType(true, SVFIntegerTy, byteSize) {}
|
|
386
392
|
static inline bool classof(const SVFType* node)
|
|
387
393
|
{
|
|
388
394
|
return node->getKind() == SVFIntegerTy;
|
|
@@ -411,7 +417,7 @@ private:
|
|
|
411
417
|
|
|
412
418
|
public:
|
|
413
419
|
SVFFunctionType(const SVFType* rt)
|
|
414
|
-
: SVFType(false, SVFFunctionTy), retTy(rt)
|
|
420
|
+
: SVFType(false, SVFFunctionTy, 0), retTy(rt)
|
|
415
421
|
{
|
|
416
422
|
}
|
|
417
423
|
static inline bool classof(const SVFType* node)
|
|
@@ -436,7 +442,7 @@ private:
|
|
|
436
442
|
std::string name;
|
|
437
443
|
|
|
438
444
|
public:
|
|
439
|
-
SVFStructType() : SVFType(false, SVFStructTy) {}
|
|
445
|
+
SVFStructType(u32_t byteSize) : SVFType(false, SVFStructTy, byteSize) {}
|
|
440
446
|
|
|
441
447
|
static inline bool classof(const SVFType* node)
|
|
442
448
|
{
|
|
@@ -469,8 +475,8 @@ private:
|
|
|
469
475
|
const SVFType* typeOfElement; /// For printing & debugging
|
|
470
476
|
|
|
471
477
|
public:
|
|
472
|
-
SVFArrayType()
|
|
473
|
-
: SVFType(false, SVFArrayTy), numOfElement(0), typeOfElement(nullptr)
|
|
478
|
+
SVFArrayType(u32_t byteSize)
|
|
479
|
+
: SVFType(false, SVFArrayTy, byteSize), numOfElement(0), typeOfElement(nullptr)
|
|
474
480
|
{
|
|
475
481
|
}
|
|
476
482
|
|
|
@@ -507,7 +513,7 @@ private:
|
|
|
507
513
|
std::string repr; /// Field representation for printing
|
|
508
514
|
|
|
509
515
|
public:
|
|
510
|
-
SVFOtherType(bool isSingleValueTy) : SVFType(isSingleValueTy, SVFOtherTy) {}
|
|
516
|
+
SVFOtherType(u32_t byteSize, bool isSingleValueTy) : SVFType(isSingleValueTy, SVFOtherTy, byteSize) {}
|
|
511
517
|
|
|
512
518
|
static inline bool classof(const SVFType* node)
|
|
513
519
|
{
|