35using namespace SVFUtil;
40 if(
slice->isSatisfiableForPairs() ==
false)
72 if(fun->
getName() ==
"SAFEMALLOC")
74 if(
slice->isSatisfiableForPairs() ==
true)
77 else if(fun->
getName() ==
"DOUBLEFREEMALLOC")
79 if(
slice->isSatisfiableForPairs() ==
false)
82 else if(fun->
getName() ==
"DOUBLEFREEMALLOCFN" || fun->
getName() ==
"SAFEMALLOCFP")
88 writeWrnMsg(
"\t can not validate, check function not found, please put it at the right place!!");
99 outs() <<
"\t\t double free path: \n" <<
slice->evalFinalCond() <<
"\n";
107 assert(
false &&
"test case failed!");
118 if(fun->
getName() ==
"DOUBLEFREEMALLOCFN")
120 if(
slice->isSatisfiableForPairs() ==
true)
123 else if(fun->
getName() ==
"SAFEMALLOCFP")
125 if(
slice->isSatisfiableForPairs() ==
false)
128 else if(fun->
getName() ==
"SAFEMALLOC" || fun->
getName() ==
"DOUBLEFREEMALLOC")
134 writeWrnMsg(
"\t can not validate, check function not found, please put it at the right place!!");
145 outs() <<
"\t\t double free path: \n" <<
slice->evalFinalCond() <<
"\n";
150 <<
" check <src id:" <<
source->getId()
154 assert(
false &&
"test case failed!");
const std::string getSourceLoc() const override
const SVFFunction * getCalledFunction() const
void testsValidation(ProgSlice *slice)
Validate test cases for regression test purpose.
void validateSuccessTests(ProgSlice *slice, const SVFFunction *fun)
void validateExpectedFailureTests(ProgSlice *slice, const SVFFunction *fun)
void reportBug(ProgSlice *slice) override
Report file/close bugs.
std::vector< SVFBugEvent > EventStack
const CallICFGNode * getSrcCSID(const SVFGNode *src)
static const Option< bool > ValidateTests
void addSaberBug(GenericBug::BugType bugType, const GenericBug::EventStack &eventStack)
const std::string & getName() const
std::string sucMsg(const std::string &msg)
Returns successful message by converting a string into green string output.
std::string errMsg(const std::string &msg)
Print error message by converting a string into red string output.
std::ostream & errs()
Overwrite llvm::errs()
void writeWrnMsg(const std::string &msg)
Writes a message run through wrnMsg.
std::ostream & outs()
Overwrite llvm::outs()
llvm::IRBuilder IRBuilder