aboutsummaryrefslogtreecommitdiff
path: root/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
commitec8d420d4fa57fc6b5a5a2b1446742e976a7ba00 (patch)
treed7d3d58808c9f042f0b0295a04fa204fd77cc1f3 /lib/StaticAnalyzer/Checkers/MallocChecker.cpp
parent889b99e6d5b389c0ed99e7ad8470c28b146a42d3 (diff)
[analyzer] Rename ConditionTruthVal::isTrue to isConstrainedTrue.
(and the same for isFalse) No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167186 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/MallocChecker.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/MallocChecker.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
index 24a38a604c..1a6e250321 100644
--- a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+++ b/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()) {