aboutsummaryrefslogtreecommitdiff
path: root/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
commit7360fda1efd88fd28ca2882579676dbd8569c181 (patch)
tree923c21a0fa78f3ce6a44f56489f01e5e8c29adaf /lib/Analysis/GRExprEngine.cpp
parent644f5fc35c9d093b2ae1e8f43cf5a70680b5945a (diff)
Implement second part of PR 2600: NSError** parameter may be null, and should be checked before being dereferenced.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56318 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r--lib/Analysis/GRExprEngine.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index aa5ab6af7f..8d6fea7f7c 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/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.