]> granicus.if.org Git - clang/commitdiff
Add an assert() to catch errors using EvalLoad(). Reviewed by kremenek.
authorZhanyong Wan <wan@google.com>
Wed, 24 Nov 2010 01:47:11 +0000 (01:47 +0000)
committerZhanyong Wan <wan@google.com>
Wed, 24 Nov 2010 01:47:11 +0000 (01:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120073 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/GRExprEngine.cpp

index 4483cdb76c4b9f3092ca3144e228463db893105c..30ac9cefbbb8364c8a1f7c3d0f3bf3cdb0537604 100644 (file)
@@ -1957,10 +1957,11 @@ void GRExprEngine::EvalStore(ExplodedNodeSet& Dst, const Expr *AssignE,
     EvalBind(Dst, StoreE, *NI, GetState(*NI), location, Val);
 }
 
-void GRExprEngine::EvalLoad(ExplodedNodeSet& Dst, const Expr *Ex, 
+void GRExprEngine::EvalLoad(ExplodedNodeSet& Dst, const Expr *Ex,
                             ExplodedNode* Pred,
                             const GRState* state, SVal location,
                             const void *tag, QualType LoadTy) {
+  assert(!isa<NonLoc>(location) && "location cannot be a NonLoc.");
 
   // Are we loading from a region?  This actually results in two loads; one
   // to fetch the address of the referenced value and one to fetch the