diff options
Diffstat (limited to 'lib/Analysis/MallocChecker.cpp')
-rw-r--r-- | lib/Analysis/MallocChecker.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Analysis/MallocChecker.cpp b/lib/Analysis/MallocChecker.cpp index cbc115f9da..f007aa65da 100644 --- a/lib/Analysis/MallocChecker.cpp +++ b/lib/Analysis/MallocChecker.cpp @@ -12,6 +12,7 @@ // //===----------------------------------------------------------------------===// +#include "GRExprEngineExperimentalChecks.h" #include "clang/Analysis/PathSensitive/CheckerVisitor.h" #include "clang/Analysis/PathSensitive/GRState.h" #include "clang/Analysis/PathSensitive/GRStateTrait.h" @@ -33,8 +34,11 @@ class VISIBILITY_HIDDEN MallocChecker : public CheckerVisitor<MallocChecker> { IdentifierInfo *II_free; public: + MallocChecker() : BT_DoubleFree(0) {} static void *getTag(); void PostVisitCallExpr(CheckerContext &C, const CallExpr *CE); + void EvalDeadSymbols(CheckerContext &C,const Stmt *S,SymbolReaper &SymReaper); +private: void MallocMem(CheckerContext &C, const CallExpr *CE); void FreeMem(CheckerContext &C, const CallExpr *CE); }; @@ -59,6 +63,10 @@ namespace clang { }; } +void clang::RegisterMallocChecker(GRExprEngine &Eng) { + Eng.registerCheck(new MallocChecker()); +} + void *MallocChecker::getTag() { static int x; return &x; @@ -124,3 +132,7 @@ void MallocChecker::FreeMem(CheckerContext &C, const CallExpr *CE) { const GRState *FreedState = state->set<RegionState>(Sym, Released); C.addTransition(C.GenerateNode(CE, FreedState)); } + +void MallocChecker::EvalDeadSymbols(CheckerContext &C, const Stmt *S, + SymbolReaper &SymReaper) { +} |