diff options
| author | Ted Kremenek <kremenek@apple.com> | 2008-09-18 23:09:54 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2008-09-18 23:09:54 +0000 |
| commit | b42f482c917e7b2251ef5bcc5532cca142b793a6 (patch) | |
| tree | 58e81a0e79e65ded9465c3eb80464f5a9e9cb555 /clang/lib/Analysis/GRExprEngine.cpp | |
| parent | c38b3fbc4c7693ea5cc5abaa07a695c306c535c9 (diff) | |
| download | bcm5719-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.cpp | 7 |
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. |

