//
//===----------------------------------------------------------------------===//
+#include "GRExprEngineExperimentalChecks.h"
#include "clang/Analysis/PathSensitive/CheckerVisitor.h"
#include "clang/Analysis/PathSensitive/GRState.h"
#include "clang/Analysis/PathSensitive/GRStateTrait.h"
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);
};
};
}
+void clang::RegisterMallocChecker(GRExprEngine &Eng) {
+ Eng.registerCheck(new MallocChecker());
+}
+
void *MallocChecker::getTag() {
static int x;
return &x;
const GRState *FreedState = state->set<RegionState>(Sym, Released);
C.addTransition(C.GenerateNode(CE, FreedState));
}
+
+void MallocChecker::EvalDeadSymbols(CheckerContext &C, const Stmt *S,
+ SymbolReaper &SymReaper) {
+}