diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-03-20 20:10:45 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-03-20 20:10:45 +0000 |
commit | bb9b2711ded08d39f9c9aa08b06ac5e288f32c62 (patch) | |
tree | a5d35ab986b1eda097b74dc905003237b7763db5 /lib/Analysis/GRExprEngine.cpp | |
parent | 9ecede735e6b180676846e95844a846ff7c251e0 (diff) |
GRExprEngine:
- Conjure symbols at '--' and '++' unary operations
- Add utility method SVal::GetConjuredSymbolVal() and constify some arguments
along the way.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r-- | lib/Analysis/GRExprEngine.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp index 1f47bc7f33..80467ebb27 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Analysis/GRExprEngine.cpp @@ -2449,7 +2449,13 @@ void GRExprEngine::VisitUnaryOperator(UnaryOperator* U, NodeTy* Pred, BinaryOperator::Opcode Op = U->isIncrementOp() ? BinaryOperator::Add : BinaryOperator::Sub; - SVal Result = EvalBinOp(Op, V2, MakeConstantVal(1U, U)); + SVal Result = EvalBinOp(Op, V2, MakeConstantVal(1U, U)); + + // Conjure a new symbol if necessary to recover precision. + if (Result.isUnknown() || !getConstraintManager().canReasonAbout(Result)) + Result = SVal::GetConjuredSymbolVal(SymMgr, Ex, + Builder->getCurrentBlockCount()); + state = BindExpr(state, U, U->isPostfix() ? V2 : Result); // Perform the store. |