summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorZhanyong Wan <wan@google.com>2010-11-24 01:47:11 +0000
committerZhanyong Wan <wan@google.com>2010-11-24 01:47:11 +0000
commit8e82c6372ad069056e5fa12602e0a8bcc293d383 (patch)
tree72fd87bfc37373aa7cccea8dc6413fd1d3daa9a9 /clang/lib
parentcf3475172f8e926963912a79a27e4947a175a4b0 (diff)
downloadbcm5719-llvm-8e82c6372ad069056e5fa12602e0a8bcc293d383.tar.gz
bcm5719-llvm-8e82c6372ad069056e5fa12602e0a8bcc293d383.zip
Add an assert() to catch errors using EvalLoad(). Reviewed by kremenek.
llvm-svn: 120073
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Checker/GRExprEngine.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Checker/GRExprEngine.cpp b/clang/lib/Checker/GRExprEngine.cpp
index 4483cdb76c4..30ac9cefbbb 100644
--- a/clang/lib/Checker/GRExprEngine.cpp
+++ b/clang/lib/Checker/GRExprEngine.cpp
@@ -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
OpenPOWER on IntegriCloud