summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/GRExprEngine.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-09-18 23:09:54 +0000
committerTed Kremenek <kremenek@apple.com>2008-09-18 23:09:54 +0000
commitb42f482c917e7b2251ef5bcc5532cca142b793a6 (patch)
tree58e81a0e79e65ded9465c3eb80464f5a9e9cb555 /clang/lib/Analysis/GRExprEngine.cpp
parentc38b3fbc4c7693ea5cc5abaa07a695c306c535c9 (diff)
downloadbcm5719-llvm-b42f482c917e7b2251ef5bcc5532cca142b793a6.tar.gz
bcm5719-llvm-b42f482c917e7b2251ef5bcc5532cca142b793a6.zip
Implement second part of PR 2600: NSError** parameter may be null, and should be checked before being dereferenced.
llvm-svn: 56318
Diffstat (limited to 'clang/lib/Analysis/GRExprEngine.cpp')
-rw-r--r--clang/lib/Analysis/GRExprEngine.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp
index aa5ab6af7fa..8d6fea7f7c7 100644
--- a/clang/lib/Analysis/GRExprEngine.cpp
+++ b/clang/lib/Analysis/GRExprEngine.cpp
@@ -1010,10 +1010,15 @@ const GRState* GRExprEngine::EvalLocation(Expr* Ex, NodeTy* Pred,
// "Assume" that the pointer is NULL.
bool isFeasibleNull = false;
- const GRState* StNull = Assume(St, LV, false, isFeasibleNull);
+ GRStateRef StNull = GRStateRef(Assume(St, LV, false, isFeasibleNull),
+ getStateManager());
if (isFeasibleNull) {
+ // Use the Generic Data Map to mark in the state what lval was null.
+ const RVal* PersistentLV = getBasicVals().getPersistentRVal(LV);
+ StNull = StNull.set<GRState::NullDerefTag>(PersistentLV);
+
// We don't use "MakeNode" here because the node will be a sink
// and we have no intention of processing it later.
OpenPOWER on IntegriCloud