svf-lib 1.0.1603 → 1.0.1605
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-linux/Release-build/svf-llvm/libSvfLLVM.a +0 -0
- package/SVF-linux/svf/include/Util/SVFBugReport.h +33 -1
- 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/SVFIR/SVFType.h +0 -6
- package/SVF-osx/svf/include/SVFIR/SVFValue.h +2 -31
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
@@ -83,7 +83,7 @@ public:
|
|
|
83
83
|
typedef std::vector<SVFBugEvent> EventStack;
|
|
84
84
|
|
|
85
85
|
public:
|
|
86
|
-
enum BugType {FULLBUFOVERFLOW, PARTIALBUFOVERFLOW, NEVERFREE, PARTIALLEAK, DOUBLEFREE, FILENEVERCLOSE, FILEPARTIALCLOSE};
|
|
86
|
+
enum BugType {FULLBUFOVERFLOW, PARTIALBUFOVERFLOW, NEVERFREE, PARTIALLEAK, DOUBLEFREE, FILENEVERCLOSE, FILEPARTIALCLOSE, FULLNULLPTRDEREFERENCE, PARTIALNULLPTRDEREFERENCE};
|
|
87
87
|
static const std::map<GenericBug::BugType, std::string> BugType2Str;
|
|
88
88
|
|
|
89
89
|
protected:
|
|
@@ -253,6 +253,38 @@ public:
|
|
|
253
253
|
}
|
|
254
254
|
};
|
|
255
255
|
|
|
256
|
+
class FullNullPtrDereferenceBug : public GenericBug
|
|
257
|
+
{
|
|
258
|
+
public:
|
|
259
|
+
FullNullPtrDereferenceBug(const EventStack &bugEventStack):
|
|
260
|
+
GenericBug(GenericBug::FULLNULLPTRDEREFERENCE, bugEventStack) { }
|
|
261
|
+
|
|
262
|
+
cJSON *getBugDescription() const;
|
|
263
|
+
void printBugToTerminal() const;
|
|
264
|
+
|
|
265
|
+
/// ClassOf
|
|
266
|
+
static inline bool classof(const GenericBug *bug)
|
|
267
|
+
{
|
|
268
|
+
return bug->getBugType() == GenericBug::FULLNULLPTRDEREFERENCE;
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
class PartialNullPtrDereferenceBug : public GenericBug
|
|
273
|
+
{
|
|
274
|
+
public:
|
|
275
|
+
PartialNullPtrDereferenceBug(const EventStack &bugEventStack):
|
|
276
|
+
GenericBug(GenericBug::PARTIALNULLPTRDEREFERENCE, bugEventStack) { }
|
|
277
|
+
|
|
278
|
+
cJSON *getBugDescription() const;
|
|
279
|
+
void printBugToTerminal() const;
|
|
280
|
+
|
|
281
|
+
/// ClassOf
|
|
282
|
+
static inline bool classof(const GenericBug *bug)
|
|
283
|
+
{
|
|
284
|
+
return bug->getBugType() == GenericBug::PARTIALNULLPTRDEREFERENCE;
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
|
|
256
288
|
class SVFBugReport
|
|
257
289
|
{
|
|
258
290
|
public:
|
|
Binary file
|
|
Binary file
|
|
@@ -507,12 +507,6 @@ public:
|
|
|
507
507
|
void print(std::ostream& os) const override;
|
|
508
508
|
};
|
|
509
509
|
|
|
510
|
-
/// [FOR DEBUG ONLY, DON'T USE IT UNSIDE `svf`!]
|
|
511
|
-
/// Converts an SVFType to corresponding LLVM::Type, then get the string
|
|
512
|
-
/// representation of it. Use it only when you are debugging. Don't use
|
|
513
|
-
/// it in any SVF algorithm because it relies on information stored in LLVM bc.
|
|
514
|
-
std::string dumpLLVMType(const SVFType* svfType);
|
|
515
|
-
|
|
516
510
|
// TODO: be explicit that this is a pair of 32-bit unsigneds?
|
|
517
511
|
template <> struct Hash<NodePair>
|
|
518
512
|
{
|
|
@@ -255,18 +255,14 @@ public:
|
|
|
255
255
|
return sourceLoc;
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
///
|
|
259
|
-
/// string concatenation.
|
|
258
|
+
/// Needs to be implemented by a SVF front end
|
|
260
259
|
std::string toString() const;
|
|
261
260
|
|
|
262
|
-
virtual void print(OutStream& os) const = 0;
|
|
263
|
-
|
|
264
261
|
/// Overloading operator << for dumping ICFG node ID
|
|
265
262
|
//@{
|
|
266
263
|
friend OutStream& operator<<(OutStream &os, const SVFValue &value)
|
|
267
264
|
{
|
|
268
|
-
value.
|
|
269
|
-
return os;
|
|
265
|
+
return os << value.toString();
|
|
270
266
|
}
|
|
271
267
|
//@}
|
|
272
268
|
};
|
|
@@ -335,8 +331,6 @@ public:
|
|
|
335
331
|
return node->getKind() == SVFFunc;
|
|
336
332
|
}
|
|
337
333
|
|
|
338
|
-
void print(OutStream& os) const override;
|
|
339
|
-
|
|
340
334
|
inline SVFLoopAndDomInfo* getLoopAndDomInfo()
|
|
341
335
|
{
|
|
342
336
|
return loopAndDom;
|
|
@@ -532,8 +526,6 @@ public:
|
|
|
532
526
|
return node->getKind() == SVFBB;
|
|
533
527
|
}
|
|
534
528
|
|
|
535
|
-
void print(OutStream& os) const override;
|
|
536
|
-
|
|
537
529
|
inline const std::vector<const SVFInstruction*>& getInstructionList() const
|
|
538
530
|
{
|
|
539
531
|
return allInsts;
|
|
@@ -619,8 +611,6 @@ public:
|
|
|
619
611
|
node->getKind() == SVFVCall;
|
|
620
612
|
}
|
|
621
613
|
|
|
622
|
-
void print(OutStream& os) const override;
|
|
623
|
-
|
|
624
614
|
inline const SVFBasicBlock* getParent() const
|
|
625
615
|
{
|
|
626
616
|
return bb;
|
|
@@ -817,7 +807,6 @@ public:
|
|
|
817
807
|
node->getKind() == SVFBlackHole;
|
|
818
808
|
}
|
|
819
809
|
|
|
820
|
-
void print(OutStream& os) const override;
|
|
821
810
|
};
|
|
822
811
|
|
|
823
812
|
class SVFGlobalValue : public SVFConstant
|
|
@@ -845,8 +834,6 @@ public:
|
|
|
845
834
|
}
|
|
846
835
|
SVFGlobalValue() = delete;
|
|
847
836
|
|
|
848
|
-
void print(OutStream& os) const override;
|
|
849
|
-
|
|
850
837
|
inline const SVFValue* getDefGlobalForMultipleModule() const
|
|
851
838
|
{
|
|
852
839
|
if(realDefGlobal==nullptr)
|
|
@@ -880,8 +867,6 @@ public:
|
|
|
880
867
|
}
|
|
881
868
|
SVFArgument() = delete;
|
|
882
869
|
|
|
883
|
-
void print(OutStream& os) const override;
|
|
884
|
-
|
|
885
870
|
inline const SVFFunction* getParent() const
|
|
886
871
|
{
|
|
887
872
|
return fun;
|
|
@@ -916,8 +901,6 @@ public:
|
|
|
916
901
|
}
|
|
917
902
|
SVFConstantData() = delete;
|
|
918
903
|
|
|
919
|
-
void print(OutStream& os) const override;
|
|
920
|
-
|
|
921
904
|
static inline bool classof(const SVFValue *node)
|
|
922
905
|
{
|
|
923
906
|
return node->getKind() == SVFConstData ||
|
|
@@ -950,8 +933,6 @@ public:
|
|
|
950
933
|
}
|
|
951
934
|
SVFConstantInt() = delete;
|
|
952
935
|
|
|
953
|
-
void print(OutStream& os) const override;
|
|
954
|
-
|
|
955
936
|
static inline bool classof(const SVFValue *node)
|
|
956
937
|
{
|
|
957
938
|
return node->getKind() == SVFConstInt;
|
|
@@ -985,8 +966,6 @@ public:
|
|
|
985
966
|
}
|
|
986
967
|
SVFConstantFP() = delete;
|
|
987
968
|
|
|
988
|
-
void print(OutStream& os) const override;
|
|
989
|
-
|
|
990
969
|
inline double getFPValue () const
|
|
991
970
|
{
|
|
992
971
|
return dval;
|
|
@@ -1013,8 +992,6 @@ public:
|
|
|
1013
992
|
}
|
|
1014
993
|
SVFConstantNullPtr() = delete;
|
|
1015
994
|
|
|
1016
|
-
void print(OutStream& os) const override;
|
|
1017
|
-
|
|
1018
995
|
static inline bool classof(const SVFValue *node)
|
|
1019
996
|
{
|
|
1020
997
|
return node->getKind() == SVFNullPtr;
|
|
@@ -1037,8 +1014,6 @@ public:
|
|
|
1037
1014
|
}
|
|
1038
1015
|
SVFBlackHoleValue() = delete;
|
|
1039
1016
|
|
|
1040
|
-
void print(OutStream& os) const override;
|
|
1041
|
-
|
|
1042
1017
|
static inline bool classof(const SVFValue *node)
|
|
1043
1018
|
{
|
|
1044
1019
|
return node->getKind() == SVFBlackHole;
|
|
@@ -1064,8 +1039,6 @@ public:
|
|
|
1064
1039
|
{
|
|
1065
1040
|
return node->getKind() == SVFOther || node->getKind() == SVFMetaAsValue;
|
|
1066
1041
|
}
|
|
1067
|
-
|
|
1068
|
-
void print(OutStream& os) const override;
|
|
1069
1042
|
};
|
|
1070
1043
|
|
|
1071
1044
|
/*
|
|
@@ -1090,8 +1063,6 @@ public:
|
|
|
1090
1063
|
{
|
|
1091
1064
|
return node->getKind() == SVFMetaAsValue;
|
|
1092
1065
|
}
|
|
1093
|
-
|
|
1094
|
-
void print(OutStream& os) const override;
|
|
1095
1066
|
};
|
|
1096
1067
|
|
|
1097
1068
|
|