summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-05-07 00:45:08 +0000
committerTed Kremenek <kremenek@apple.com>2009-05-07 00:45:08 +0000
commit75edb2e8a031c05cbb7dc13d829f9ddaefc489fe (patch)
tree6955cf02aa36089b2e2396bc27b240d31830052b
parentbaf3fee88531c68e001db6e17c9a63475b1367f3 (diff)
downloadbcm5719-llvm-75edb2e8a031c05cbb7dc13d829f9ddaefc489fe.tar.gz
bcm5719-llvm-75edb2e8a031c05cbb7dc13d829f9ddaefc489fe.zip
Bug fix: Not all ConstraintManagers always return a null state when setting
isFeasible to false. This is something we may wish to do further validation on. llvm-svn: 71134
-rw-r--r--clang/include/clang/Analysis/PathSensitive/GRState.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/clang/include/clang/Analysis/PathSensitive/GRState.h b/clang/include/clang/Analysis/PathSensitive/GRState.h
index 1a165fd6988..37af0caadf3 100644
--- a/clang/include/clang/Analysis/PathSensitive/GRState.h
+++ b/clang/include/clang/Analysis/PathSensitive/GRState.h
@@ -641,13 +641,19 @@ public:
const GRState* Assume(const GRState* St, SVal Cond, bool Assumption,
bool& isFeasible) {
- return ConstraintMgr->Assume(St, Cond, Assumption, isFeasible);
+ const GRState *state =
+ ConstraintMgr->Assume(St, Cond, Assumption, isFeasible);
+ assert(!isFeasible || state);
+ return isFeasible ? state : NULL;
}
const GRState* AssumeInBound(const GRState* St, SVal Idx, SVal UpperBound,
bool Assumption, bool& isFeasible) {
- return ConstraintMgr->AssumeInBound(St, Idx, UpperBound, Assumption,
- isFeasible);
+ const GRState *state =
+ ConstraintMgr->AssumeInBound(St, Idx, UpperBound, Assumption,
+ isFeasible);
+ assert(!isFeasible || state);
+ return isFeasible ? state : NULL;
}
const llvm::APSInt* getSymVal(const GRState* St, SymbolRef sym) {
OpenPOWER on IntegriCloud