[cfe-commits] r120073 - /cfe/trunk/lib/Checker/GRExprEngine.cpp

Zhanyong Wan wan at google.com
Tue Nov 23 17:47:11 PST 2010


Author: wan
Date: Tue Nov 23 19:47:11 2010
New Revision: 120073

URL: http://llvm.org/viewvc/llvm-project?rev=120073&view=rev
Log:
Add an assert() to catch errors using EvalLoad().  Reviewed by kremenek.

Modified:
    cfe/trunk/lib/Checker/GRExprEngine.cpp

Modified: cfe/trunk/lib/Checker/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/GRExprEngine.cpp?rev=120073&r1=120072&r2=120073&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Checker/GRExprEngine.cpp Tue Nov 23 19:47:11 2010
@@ -1957,10 +1957,11 @@
     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





More information about the cfe-commits mailing list