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!!");
104 outs() <<
"\t\t double free path: \n" <<
slice->evalFinalCond() <<
"\n";
117 assert(
false &&
"test case failed!");
128 if(fun->
getName() ==
"DOUBLEFREEMALLOCFN")
130 if(
slice->isSatisfiableForPairs() ==
true)
133 else if(fun->
getName() ==
"SAFEMALLOCFP")
135 if(
slice->isSatisfiableForPairs() ==
false)
138 else if(fun->
getName() ==
"SAFEMALLOC" || fun->
getName() ==
"DOUBLEFREEMALLOC")
144 writeWrnMsg(
"\t can not validate, check function not found, please put it at the right place!!");
160 outs() <<
"\t\t double free path: \n" <<
slice->evalFinalCond() <<
"\n";
167 assert(
false &&
"test case failed!");
171 <<
" check <src id:" <<
source->getId()
175 assert(
false &&
"test case failed!");
const FunObjVar * getCalledFunction() const
const std::string getSourceLoc() const override
void testsValidation(ProgSlice *slice)
Validate test cases for regression test purpose.
void validateExpectedFailureTests(ProgSlice *slice, const FunObjVar *fun)
void validateSuccessTests(ProgSlice *slice, const FunObjVar *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)
virtual 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