summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-11-01 00:18:27 +0000
committerJordan Rose <jordan_rose@apple.com>2012-11-01 00:18:27 +0000
commit14fe9f363163c78ff8bd7f6f29897e8215fc6cd5 (patch)
treeb6159c58bde57c33c5cf5d9ce24f4934979948ea /clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
parent8565e50ad4557d2734f84e35d800845f4fc85aa3 (diff)
downloadbcm5719-llvm-14fe9f363163c78ff8bd7f6f29897e8215fc6cd5.tar.gz
bcm5719-llvm-14fe9f363163c78ff8bd7f6f29897e8215fc6cd5.zip
[analyzer] Rename ConditionTruthVal::isTrue to isConstrainedTrue.
(and the same for isFalse) No functionality change. llvm-svn: 167186
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
index 24a38a604ca..1a6e250321c 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
@@ -1292,7 +1292,9 @@ ProgramStateRef MallocChecker::evalAssume(ProgramStateRef state,
RegionStateTy RS = state->get<RegionState>();
for (RegionStateTy::iterator I = RS.begin(), E = RS.end(); I != E; ++I) {
// If the symbol is assumed to be NULL, remove it from consideration.
- if (state->getConstraintManager().isNull(state, I.getKey()).isTrue())
+ ConstraintManager &CMgr = state->getConstraintManager();
+ ConditionTruthVal AllocFailed = CMgr.isNull(state, I.getKey());
+ if (AllocFailed.isConstrainedTrue())
state = state->remove<RegionState>(I.getKey());
}
@@ -1301,8 +1303,11 @@ ProgramStateRef MallocChecker::evalAssume(ProgramStateRef state,
ReallocMap RP = state->get<ReallocPairs>();
for (ReallocMap::iterator I = RP.begin(), E = RP.end(); I != E; ++I) {
// If the symbol is assumed to be NULL, remove it from consideration.
- if (!state->getConstraintManager().isNull(state, I.getKey()).isTrue())
+ ConstraintManager &CMgr = state->getConstraintManager();
+ ConditionTruthVal AllocFailed = CMgr.isNull(state, I.getKey());
+ if (AllocFailed.isConstrainedTrue())
continue;
+
SymbolRef ReallocSym = I.getData().ReallocatedSym;
if (const RefState *RS = state->get<RegionState>(ReallocSym)) {
if (RS->isReleased()) {
OpenPOWER on IntegriCloud