svf-lib 1.0.806 → 1.0.810
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/VFGNode.h +1 -1
- package/SVF-linux/include/MemoryModel/LocationSet.h +4 -0
- package/SVF-linux/include/MemoryModel/SVFIR.h +1 -1
- package/SVF-linux/include/MemoryModel/SVFStatements.h +25 -5
- package/SVF-linux/include/MemoryModel/SymbolTableInfo.h +27 -6
- package/SVF-linux/include/SVF-FE/SVFIRBuilder.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/DDA/DDAVFSolver.h +1 -1
- package/SVF-osx/include/MSSA/SVFGBuilder.h +0 -2
- package/SVF-osx/include/MemoryModel/LocationSet.h +4 -0
- package/SVF-osx/include/MemoryModel/SVFStatements.h +4 -0
- package/SVF-osx/include/MemoryModel/SymbolTableInfo.h +27 -6
- package/package.json +1 -1
|
Binary file
|
|
@@ -569,7 +569,7 @@ public:
|
|
|
569
569
|
u32_t getNumSuccessors() const{
|
|
570
570
|
return brstmt->getNumSuccessors();
|
|
571
571
|
}
|
|
572
|
-
const
|
|
572
|
+
const BranchStmt::SuccAndCondPairVec& getSuccessors() const{
|
|
573
573
|
return brstmt->getSuccessors();
|
|
574
574
|
}
|
|
575
575
|
const ICFGNode* getSuccessor (u32_t i) const{
|
|
@@ -131,8 +131,12 @@ public:
|
|
|
131
131
|
}
|
|
132
132
|
//@}
|
|
133
133
|
|
|
134
|
+
/// Return accumulated constant offset given OffsetValueVec
|
|
134
135
|
s64_t accumulateConstantOffset() const;
|
|
135
136
|
|
|
137
|
+
/// Return element number of a type.
|
|
138
|
+
u32_t getElementNum(const Type* type) const;
|
|
139
|
+
|
|
136
140
|
bool addOffsetValue(const Value* offsetValue, const Type* type);
|
|
137
141
|
|
|
138
142
|
/// Return TRUE if this is a constant location set.
|
|
@@ -637,7 +637,7 @@ private:
|
|
|
637
637
|
/// Add Unary edge
|
|
638
638
|
UnaryOPStmt* addUnaryOPStmt(NodeID src, NodeID dst, u32_t opcode);
|
|
639
639
|
/// Add BranchStmt
|
|
640
|
-
BranchStmt* addBranchStmt(NodeID br, NodeID cond,
|
|
640
|
+
BranchStmt* addBranchStmt(NodeID br, NodeID cond, const BranchStmt::SuccAndCondPairVec& succs);
|
|
641
641
|
/// Add Load edge
|
|
642
642
|
LoadStmt* addLoadStmt(NodeID src, NodeID dst);
|
|
643
643
|
/// Add Store edge
|
|
@@ -438,6 +438,10 @@ public:
|
|
|
438
438
|
return ls;
|
|
439
439
|
}
|
|
440
440
|
|
|
441
|
+
inline s64_t accumulateConstantOffset() const
|
|
442
|
+
{
|
|
443
|
+
return ls.accumulateConstantOffset();
|
|
444
|
+
}
|
|
441
445
|
/// offset of the gep statement
|
|
442
446
|
inline s64_t getConstantFieldIdx() const
|
|
443
447
|
{
|
|
@@ -835,6 +839,8 @@ public:
|
|
|
835
839
|
*/
|
|
836
840
|
class BranchStmt: public SVFStmt
|
|
837
841
|
{
|
|
842
|
+
public:
|
|
843
|
+
typedef std::vector<std::pair<const ICFGNode*, s64_t> > SuccAndCondPairVec;
|
|
838
844
|
private:
|
|
839
845
|
BranchStmt(); ///< place holder
|
|
840
846
|
BranchStmt(const BranchStmt &); ///< place holder
|
|
@@ -844,9 +850,10 @@ private:
|
|
|
844
850
|
NodeID getSrcID(); ///< place holder, use getOpVarID(pos) instead
|
|
845
851
|
NodeID getDstID(); ///< place holder, use getResID() instead
|
|
846
852
|
|
|
847
|
-
|
|
853
|
+
SuccAndCondPairVec successors;
|
|
848
854
|
const SVFVar* cond;
|
|
849
855
|
const SVFVar* brInst;
|
|
856
|
+
|
|
850
857
|
public:
|
|
851
858
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
852
859
|
//@{
|
|
@@ -865,7 +872,7 @@ public:
|
|
|
865
872
|
//@}
|
|
866
873
|
|
|
867
874
|
/// constructor
|
|
868
|
-
BranchStmt(SVFVar* inst, SVFVar* c, const
|
|
875
|
+
BranchStmt(SVFVar* inst, SVFVar* c, const SuccAndCondPairVec& succs) : SVFStmt(c,inst,SVFStmt::Branch), successors(succs), cond(c), brInst(inst)
|
|
869
876
|
{
|
|
870
877
|
}
|
|
871
878
|
|
|
@@ -878,18 +885,31 @@ public:
|
|
|
878
885
|
const SVFVar* getBranchInst() const{
|
|
879
886
|
return brInst;
|
|
880
887
|
}
|
|
888
|
+
|
|
889
|
+
/// For example if(c) {stmt1} else {stmt2}
|
|
890
|
+
/// successor(0): stmt1, 1
|
|
891
|
+
/// successor(1): stmt2, 0
|
|
892
|
+
|
|
893
|
+
/// For example switch(c) case 0: {stmt1; break;} case 1: {stmt2; break;} default {stmt3: break}
|
|
894
|
+
/// successor(0): stmt1, 0
|
|
895
|
+
/// successor(1): stmt2, 1
|
|
896
|
+
/// successor(3): stmt3, -1
|
|
897
|
+
|
|
881
898
|
/// Successors of this branch statement
|
|
882
899
|
///@{
|
|
883
900
|
u32_t getNumSuccessors() const{
|
|
884
901
|
return successors.size();
|
|
885
902
|
}
|
|
886
|
-
const
|
|
903
|
+
const SuccAndCondPairVec& getSuccessors() const{
|
|
887
904
|
return successors;
|
|
888
905
|
}
|
|
889
906
|
const ICFGNode* getSuccessor (u32_t i) const{
|
|
890
|
-
return successors.at(i);
|
|
907
|
+
return successors.at(i).first;
|
|
891
908
|
}
|
|
892
|
-
|
|
909
|
+
s64_t getSuccessorCondValue (u32_t i) const{
|
|
910
|
+
return successors.at(i).second;
|
|
911
|
+
}
|
|
912
|
+
//@}
|
|
893
913
|
virtual const std::string toString() const override;
|
|
894
914
|
};
|
|
895
915
|
|
|
@@ -364,7 +364,11 @@ public:
|
|
|
364
364
|
}
|
|
365
365
|
|
|
366
366
|
///Get a reference to the components of struct_info.
|
|
367
|
-
|
|
367
|
+
/// Flatterned full offset information of a struct including its array fields
|
|
368
|
+
const std::vector<u32_t>& getFlattenedOffsetVec(const StructType *T);
|
|
369
|
+
/// Flatterned field index information of a struct ignoring any array field
|
|
370
|
+
const std::vector<u32_t>& getFlattenedFieldIdxVec(const StructType *T);
|
|
371
|
+
|
|
368
372
|
const std::vector<FlattenedFieldInfo>& getFlattenedFieldInfoVec(const Type *T);
|
|
369
373
|
|
|
370
374
|
/// struct A { int id; int salary; }; struct B { char name[20]; struct A a;} B b;
|
|
@@ -501,25 +505,32 @@ public:
|
|
|
501
505
|
|
|
502
506
|
|
|
503
507
|
/*!
|
|
504
|
-
*
|
|
508
|
+
* Flatterned type information of StructType, ArrayType and SingleValueType
|
|
505
509
|
*/
|
|
506
510
|
class StInfo
|
|
507
511
|
{
|
|
508
512
|
|
|
509
513
|
private:
|
|
510
|
-
/// flattened field indices of a struct
|
|
514
|
+
/// flattened field indices of a struct (ignoring arrays)
|
|
511
515
|
std::vector<u32_t> fldIdxVec;
|
|
516
|
+
/// flattened full offset (including array strides)
|
|
517
|
+
std::vector<u32_t> fullOffsetVec;
|
|
512
518
|
/// Types of all fields of a struct
|
|
513
519
|
Map<u32_t, const Type*> fldIdx2TypeMap;
|
|
514
520
|
/// All field infos after flattening a struct
|
|
515
521
|
std::vector<FlattenedFieldInfo> finfo;
|
|
516
|
-
|
|
522
|
+
/// stride represents the number of repetitive elements if this StInfo represent an ArrayType. stride is 1 by default.
|
|
523
|
+
u32_t stride;
|
|
517
524
|
/// Max field limit
|
|
518
525
|
static u32_t maxFieldLimit;
|
|
519
526
|
|
|
527
|
+
StInfo(); ///< place holder
|
|
528
|
+
StInfo(const StInfo& st); ///< place holder
|
|
529
|
+
void operator=(const StInfo&); ///< place holder
|
|
530
|
+
|
|
520
531
|
public:
|
|
521
532
|
/// Constructor
|
|
522
|
-
StInfo()
|
|
533
|
+
StInfo(u32_t s) : stride(s)
|
|
523
534
|
{
|
|
524
535
|
}
|
|
525
536
|
/// Destructor
|
|
@@ -560,6 +571,10 @@ public:
|
|
|
560
571
|
{
|
|
561
572
|
return fldIdxVec;
|
|
562
573
|
}
|
|
574
|
+
inline std::vector<u32_t>& getFlattenedOffsetVec()
|
|
575
|
+
{
|
|
576
|
+
return fullOffsetVec;
|
|
577
|
+
}
|
|
563
578
|
inline std::vector<FlattenedFieldInfo>& getFlattenedFieldInfoVec()
|
|
564
579
|
{
|
|
565
580
|
return finfo;
|
|
@@ -567,11 +582,17 @@ public:
|
|
|
567
582
|
//@}
|
|
568
583
|
|
|
569
584
|
/// Add field (index and offset) with its corresponding type
|
|
570
|
-
inline void addFldWithType(u32_t fldIdx, const Type* type)
|
|
585
|
+
inline void addFldWithType(u32_t fldIdx, const Type* type, u32_t fullOffset)
|
|
571
586
|
{
|
|
572
587
|
fldIdxVec.push_back(fldIdx);
|
|
588
|
+
fullOffsetVec.push_back(fullOffset);
|
|
573
589
|
fldIdx2TypeMap[fldIdx] = type;
|
|
574
590
|
}
|
|
591
|
+
|
|
592
|
+
/// Array Type can have
|
|
593
|
+
inline u32_t getStride() const {
|
|
594
|
+
return stride;
|
|
595
|
+
}
|
|
575
596
|
};
|
|
576
597
|
|
|
577
598
|
/*!
|
|
@@ -331,7 +331,7 @@ public:
|
|
|
331
331
|
return edge;
|
|
332
332
|
}
|
|
333
333
|
/// Add Branch statement
|
|
334
|
-
inline BranchStmt* addBranchStmt(NodeID br, NodeID cond, const
|
|
334
|
+
inline BranchStmt* addBranchStmt(NodeID br, NodeID cond, const BranchStmt::SuccAndCondPairVec& succs){
|
|
335
335
|
BranchStmt *edge = pag->addBranchStmt(br, cond, succs);
|
|
336
336
|
setCurrentBBAndValueForPAGEdge(edge);
|
|
337
337
|
return edge;
|
|
Binary file
|
|
Binary file
|
|
@@ -290,7 +290,7 @@ protected:
|
|
|
290
290
|
virtual inline void buildSVFG(SVFIR* pag)
|
|
291
291
|
{
|
|
292
292
|
_ander = AndersenWaveDiff::createAndersenWaveDiff(pag);
|
|
293
|
-
_svfg = svfgBuilder.
|
|
293
|
+
_svfg = svfgBuilder.buildPTROnlySVFG(_ander);
|
|
294
294
|
_pag = _svfg->getPAG();
|
|
295
295
|
}
|
|
296
296
|
/// Reset visited map for next points-to query
|
|
@@ -74,9 +74,7 @@ public:
|
|
|
74
74
|
static SVFG* globalSvfg;
|
|
75
75
|
|
|
76
76
|
SVFG* buildPTROnlySVFG(BVDataPTAImpl* pta);
|
|
77
|
-
SVFG* buildPTROnlySVFGWithoutOPT(BVDataPTAImpl* pta);
|
|
78
77
|
SVFG* buildFullSVFG(BVDataPTAImpl* pta);
|
|
79
|
-
SVFG* buildFullSVFGWithoutOPT(BVDataPTAImpl* pta);
|
|
80
78
|
|
|
81
79
|
/// Clean up
|
|
82
80
|
static void releaseSVFG()
|
|
@@ -131,8 +131,12 @@ public:
|
|
|
131
131
|
}
|
|
132
132
|
//@}
|
|
133
133
|
|
|
134
|
+
/// Return accumulated constant offset given OffsetValueVec
|
|
134
135
|
s64_t accumulateConstantOffset() const;
|
|
135
136
|
|
|
137
|
+
/// Return element number of a type.
|
|
138
|
+
u32_t getElementNum(const Type* type) const;
|
|
139
|
+
|
|
136
140
|
bool addOffsetValue(const Value* offsetValue, const Type* type);
|
|
137
141
|
|
|
138
142
|
/// Return TRUE if this is a constant location set.
|
|
@@ -364,7 +364,11 @@ public:
|
|
|
364
364
|
}
|
|
365
365
|
|
|
366
366
|
///Get a reference to the components of struct_info.
|
|
367
|
-
|
|
367
|
+
/// Flatterned full offset information of a struct including its array fields
|
|
368
|
+
const std::vector<u32_t>& getFlattenedOffsetVec(const StructType *T);
|
|
369
|
+
/// Flatterned field index information of a struct ignoring any array field
|
|
370
|
+
const std::vector<u32_t>& getFlattenedFieldIdxVec(const StructType *T);
|
|
371
|
+
|
|
368
372
|
const std::vector<FlattenedFieldInfo>& getFlattenedFieldInfoVec(const Type *T);
|
|
369
373
|
|
|
370
374
|
/// struct A { int id; int salary; }; struct B { char name[20]; struct A a;} B b;
|
|
@@ -501,25 +505,32 @@ public:
|
|
|
501
505
|
|
|
502
506
|
|
|
503
507
|
/*!
|
|
504
|
-
*
|
|
508
|
+
* Flatterned type information of StructType, ArrayType and SingleValueType
|
|
505
509
|
*/
|
|
506
510
|
class StInfo
|
|
507
511
|
{
|
|
508
512
|
|
|
509
513
|
private:
|
|
510
|
-
/// flattened field indices of a struct
|
|
514
|
+
/// flattened field indices of a struct (ignoring arrays)
|
|
511
515
|
std::vector<u32_t> fldIdxVec;
|
|
516
|
+
/// flattened full offset (including array strides)
|
|
517
|
+
std::vector<u32_t> fullOffsetVec;
|
|
512
518
|
/// Types of all fields of a struct
|
|
513
519
|
Map<u32_t, const Type*> fldIdx2TypeMap;
|
|
514
520
|
/// All field infos after flattening a struct
|
|
515
521
|
std::vector<FlattenedFieldInfo> finfo;
|
|
516
|
-
|
|
522
|
+
/// stride represents the number of repetitive elements if this StInfo represent an ArrayType. stride is 1 by default.
|
|
523
|
+
u32_t stride;
|
|
517
524
|
/// Max field limit
|
|
518
525
|
static u32_t maxFieldLimit;
|
|
519
526
|
|
|
527
|
+
StInfo(); ///< place holder
|
|
528
|
+
StInfo(const StInfo& st); ///< place holder
|
|
529
|
+
void operator=(const StInfo&); ///< place holder
|
|
530
|
+
|
|
520
531
|
public:
|
|
521
532
|
/// Constructor
|
|
522
|
-
StInfo()
|
|
533
|
+
StInfo(u32_t s) : stride(s)
|
|
523
534
|
{
|
|
524
535
|
}
|
|
525
536
|
/// Destructor
|
|
@@ -560,6 +571,10 @@ public:
|
|
|
560
571
|
{
|
|
561
572
|
return fldIdxVec;
|
|
562
573
|
}
|
|
574
|
+
inline std::vector<u32_t>& getFlattenedOffsetVec()
|
|
575
|
+
{
|
|
576
|
+
return fullOffsetVec;
|
|
577
|
+
}
|
|
563
578
|
inline std::vector<FlattenedFieldInfo>& getFlattenedFieldInfoVec()
|
|
564
579
|
{
|
|
565
580
|
return finfo;
|
|
@@ -567,11 +582,17 @@ public:
|
|
|
567
582
|
//@}
|
|
568
583
|
|
|
569
584
|
/// Add field (index and offset) with its corresponding type
|
|
570
|
-
inline void addFldWithType(u32_t fldIdx, const Type* type)
|
|
585
|
+
inline void addFldWithType(u32_t fldIdx, const Type* type, u32_t fullOffset)
|
|
571
586
|
{
|
|
572
587
|
fldIdxVec.push_back(fldIdx);
|
|
588
|
+
fullOffsetVec.push_back(fullOffset);
|
|
573
589
|
fldIdx2TypeMap[fldIdx] = type;
|
|
574
590
|
}
|
|
591
|
+
|
|
592
|
+
/// Array Type can have
|
|
593
|
+
inline u32_t getStride() const {
|
|
594
|
+
return stride;
|
|
595
|
+
}
|
|
575
596
|
};
|
|
576
597
|
|
|
577
598
|
/*!
|