From 5a8e4529de91dadb1f6c15d38a60da72510be432 Mon Sep 17 00:00:00 2001 From: joelyyoung Date: Sun, 9 Jul 2023 09:18:13 +0800 Subject: [PATCH 1/2] add 2 bug types to SVFBugReport --- svf/include/Util/SVFBugReport.h | 12 ++++++++++++ svf/lib/Util/SVFBugReport.cpp | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/svf/include/Util/SVFBugReport.h b/svf/include/Util/SVFBugReport.h index 1a682100d..5b7b872be 100644 --- a/svf/include/Util/SVFBugReport.h +++ b/svf/include/Util/SVFBugReport.h @@ -338,6 +338,18 @@ class SVFBugReport bugSet.insert(newBug); break; } + case GenericBug::FULLNULLPTRDEREFERENCE: + { + newBug = new FullNullPtrDereferenceBug(eventStack); + bugSet.insert(newBug); + break; + } + case GenericBug::PARTIALNULLPTRDEREFERENCE: + { + newBug = new PartialNullPtrDereferenceBug(eventStack); + bugSet.insert(newBug); + break; + } default: { assert(false && "saber does NOT have this bug type!"); diff --git a/svf/lib/Util/SVFBugReport.cpp b/svf/lib/Util/SVFBugReport.cpp index 9909d6a54..2c710d5be 100644 --- a/svf/lib/Util/SVFBugReport.cpp +++ b/svf/lib/Util/SVFBugReport.cpp @@ -43,7 +43,9 @@ const std::map GenericBug::BugType2Str = {GenericBug::PARTIALLEAK, "Partial Leak"}, {GenericBug::FILENEVERCLOSE, "File Never Close"}, {GenericBug::FILEPARTIALCLOSE, "File Partial Close"}, - {GenericBug::DOUBLEFREE, "Double Free"} + {GenericBug::DOUBLEFREE, "Double Free"}, + {GenericBug::FULLNULLPTRDEREFERENCE, "Full Null Ptr Dereference"}, + {GenericBug::PARTIALNULLPTRDEREFERENCE, "Partial Null Ptr Dereference"} }; const std::string GenericBug::getLoc() const From cd806ee1533d427e1b02485a2ec89ccae8792fd3 Mon Sep 17 00:00:00 2001 From: joelyyoung Date: Sun, 9 Jul 2023 09:25:22 +0800 Subject: [PATCH 2/2] add 2 bug types to SVFBugReport --- svf/include/Util/SVFBugReport.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/svf/include/Util/SVFBugReport.h b/svf/include/Util/SVFBugReport.h index 5b7b872be..48037d8f3 100644 --- a/svf/include/Util/SVFBugReport.h +++ b/svf/include/Util/SVFBugReport.h @@ -338,18 +338,6 @@ class SVFBugReport bugSet.insert(newBug); break; } - case GenericBug::FULLNULLPTRDEREFERENCE: - { - newBug = new FullNullPtrDereferenceBug(eventStack); - bugSet.insert(newBug); - break; - } - case GenericBug::PARTIALNULLPTRDEREFERENCE: - { - newBug = new PartialNullPtrDereferenceBug(eventStack); - bugSet.insert(newBug); - break; - } default: { assert(false && "saber does NOT have this bug type!"); @@ -385,6 +373,18 @@ class SVFBugReport bugSet.insert(newBug); break; } + case GenericBug::FULLNULLPTRDEREFERENCE: + { + newBug = new FullNullPtrDereferenceBug(eventStack); + bugSet.insert(newBug); + break; + } + case GenericBug::PARTIALNULLPTRDEREFERENCE: + { + newBug = new PartialNullPtrDereferenceBug(eventStack); + bugSet.insert(newBug); + break; + } default: { assert(false && "Abstract Execution does NOT hava his bug type!");