[cfe-commits] r71134 - /cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h

Ted Kremenek kremenek at apple.com
Wed May 6 17:45:08 PDT 2009


Author: kremenek
Date: Wed May  6 19:45:08 2009
New Revision: 71134

URL: http://llvm.org/viewvc/llvm-project?rev=71134&view=rev
Log:
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.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h?rev=71134&r1=71133&r2=71134&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h Wed May  6 19:45:08 2009
@@ -641,13 +641,19 @@
 
   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) {





More information about the cfe-commits mailing list