diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-02-26 23:37:01 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-02-26 23:37:01 +0000 |
commit | 5a7b3821c6abed7f58a53a94eac128bd23d23289 (patch) | |
tree | b3600b7898c70c2471f3d7a4d2464c06f3027b7a /Analysis/ValueState.cpp | |
parent | 06747691096654742d9ed7342e63828456b4f40c (diff) |
Fix bug when processing '?' operator: invalidate the old "Uninitialized" value of the block-level expression for ?.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47645 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Analysis/ValueState.cpp')
-rw-r--r-- | Analysis/ValueState.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/Analysis/ValueState.cpp b/Analysis/ValueState.cpp index 7be59ce5f5..97a090dad7 100644 --- a/Analysis/ValueState.cpp +++ b/Analysis/ValueState.cpp @@ -387,12 +387,27 @@ RVal ValueStateManager::GetLVal(ValueState St, Expr* E) { } ValueState -ValueStateManager::SetRVal(ValueState St, Expr* E, bool isBlkExpr, RVal V) { +ValueStateManager::SetRVal(ValueState St, Expr* E, RVal V, + bool isBlkExpr, bool Invalidate) { assert (E); - if (V.isUnknown()) + if (V.isUnknown()) { + + if (Invalidate) { + + ValueStateImpl NewSt = *St; + + if (isBlkExpr) + NewSt.BlockExprBindings = EXFactory.Remove(NewSt.BlockExprBindings, E); + else + NewSt.SubExprBindings = EXFactory.Remove(NewSt.SubExprBindings, E); + + return getPersistentState(NewSt); + } + return St; + } ValueStateImpl NewSt = *St; @@ -406,8 +421,8 @@ ValueStateManager::SetRVal(ValueState St, Expr* E, bool isBlkExpr, RVal V) { return getPersistentState(NewSt); } -ValueState -ValueStateManager::SetRVal(ValueState St, LVal LV, RVal V) { + +ValueState ValueStateManager::SetRVal(ValueState St, LVal LV, RVal V) { switch (LV.getSubKind()) { |