summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-01-11 19:45:13 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-01-11 19:45:13 +0000
commit1790c975e76d9cb267b78b190d2aaaf62060a4c1 (patch)
treee38cdfcdcb7dfab153ea804c9fe67ed9c5e94d71 /clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
parent32bd3a1e9a05f6d2ea8bb9d1d666e20d12091edb (diff)
downloadbcm5719-llvm-1790c975e76d9cb267b78b190d2aaaf62060a4c1.tar.gz
bcm5719-llvm-1790c975e76d9cb267b78b190d2aaaf62060a4c1.zip
[analyzer] Add 'isLoad' parameter in Checker::visitLocation() to conveniently distinguish between loads/stores.
llvm-svn: 123261
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
index 9375947abba..36968ecd1f3 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
@@ -82,7 +82,7 @@ public:
void PreVisitReturnStmt(CheckerContext &C, const ReturnStmt *S);
const GRState *evalAssume(const GRState *state, SVal Cond, bool Assumption,
bool *respondsToCallback);
- void visitLocation(CheckerContext &C, const Stmt *S, SVal l);
+ void visitLocation(CheckerContext &C, const Stmt *S, SVal l, bool isLoad);
virtual void PreVisitBind(CheckerContext &C, const Stmt *StoreE,
SVal location, SVal val);
@@ -653,7 +653,8 @@ const GRState *MallocChecker::evalAssume(const GRState *state, SVal Cond,
}
// Check if the location is a freed symbolic region.
-void MallocChecker::visitLocation(CheckerContext &C, const Stmt *S, SVal l) {
+void MallocChecker::visitLocation(CheckerContext &C, const Stmt *S, SVal l,
+ bool isLoad) {
SymbolRef Sym = l.getLocSymbolInBase();
if (Sym) {
const RefState *RS = C.getState()->get<RegionState>(Sym);
OpenPOWER on IntegriCloud