diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-05-07 00:45:08 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-05-07 00:45:08 +0000 |
commit | 46a54eb500aa1f841308ad78ef356d28b1bbb0cc (patch) | |
tree | 02875c821c97e3f8472624853bcd61a2f7402900 | |
parent | bfa2fcba545fb270f31205d616846c2bfaf4e47e (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71134 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Analysis/PathSensitive/GRState.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/include/clang/Analysis/PathSensitive/GRState.h b/include/clang/Analysis/PathSensitive/GRState.h index 1a165fd698..37af0caadf 100644 --- a/include/clang/Analysis/PathSensitive/GRState.h +++ b/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) { |