diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-04-30 04:23:07 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-04-30 04:23:07 +0000 |
commit | 5cc9e60a5f2e03f89a24ba8e598f4212e3708353 (patch) | |
tree | 4751e29d5078f75b4f497fa5bf711d89079fb7ad /clang/lib/Analysis/GRExprEngine.cpp | |
parent | a1d850ee1cdc2576f34cc38ac3018eb850ab33fe (diff) | |
download | bcm5719-llvm-5cc9e60a5f2e03f89a24ba8e598f4212e3708353.tar.gz bcm5719-llvm-5cc9e60a5f2e03f89a24ba8e598f4212e3708353.zip |
Invalidate old subexpression bindings when binding UnknownVal.
llvm-svn: 50466
Diffstat (limited to 'clang/lib/Analysis/GRExprEngine.cpp')
-rw-r--r-- | clang/lib/Analysis/GRExprEngine.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp index a7b31d5b6dd..d9a2313aa18 100644 --- a/clang/lib/Analysis/GRExprEngine.cpp +++ b/clang/lib/Analysis/GRExprEngine.cpp @@ -157,7 +157,7 @@ ValueState* GRExprEngine::SetRVal(ValueState* St, Expr* Ex, RVal V) { return St; } - return StateMgr.SetRVal(St, Ex, V, isBlkExpr, false); + return StateMgr.SetRVal(St, Ex, V, isBlkExpr, true); } //===----------------------------------------------------------------------===// @@ -890,8 +890,12 @@ void GRExprEngine::EvalLoad(NodeSet& Dst, Expr* Ex, NodeTy* Pred, // FIXME: The "CheckOnly" option exists only because Array and Field // loads aren't fully implemented. Eventually this option will go away. - if (location.isUnknown() || CheckOnly) + if (CheckOnly) MakeNode(Dst, Ex, Pred, St); + else if (location.isUnknown()) { + // This is important. We must nuke the old binding. + MakeNode(Dst, Ex, Pred, SetRVal(St, Ex, UnknownVal())); + } else MakeNode(Dst, Ex, Pred, SetRVal(St, Ex, GetRVal(St, cast<LVal>(location), Ex->getType()))); @@ -1593,7 +1597,7 @@ void GRExprEngine::VisitUnaryOperator(UnaryOperator* U, NodeTy* Pred, St = SetRVal(St, U, U->isPostfix() ? V2 : Result); // Perform the store. - EvalStore(Dst, U, *I, St, V1, Result); + EvalStore(Dst, U, *I2, St, V1, Result); } } } |