diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-07-21 21:03:30 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-07-21 21:03:30 +0000 |
commit | 32c3fa4195762ba93f0b7114ab36c0941bc34432 (patch) | |
tree | c6c22b635c76549ba054bf4b2d5d8a6068e5783c /lib/Analysis/ValueManager.cpp | |
parent | cb077fc8e0d440f024bbdf57983b84b6d658b60b (diff) |
Fix PR 4594 by refactoring almost all casting logic from GRExprEngine::VisitCast
to SValuator::EvalCast. In the process, the StoreManagers now use this new cast
machinery, and the hack in GRExprEngine::EvalBind to handle implicit casts
involving OSAtomicCompareAndSwap and friends has been removed (and replaced with
logic closer to the logic specific to those functions).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76641 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ValueManager.cpp')
-rw-r--r-- | lib/Analysis/ValueManager.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Analysis/ValueManager.cpp b/lib/Analysis/ValueManager.cpp index 658dfa1186..ee6b5cbeeb 100644 --- a/lib/Analysis/ValueManager.cpp +++ b/lib/Analysis/ValueManager.cpp @@ -56,6 +56,9 @@ NonLoc ValueManager::makeNonLoc(const SymExpr *lhs, BinaryOperator::Opcode op, SVal ValueManager::convertToArrayIndex(SVal V) { + if (V.isUnknownOrUndef()) + return V; + // Common case: we have an appropriately sized integer. if (nonloc::ConcreteInt* CI = dyn_cast<nonloc::ConcreteInt>(&V)) { const llvm::APSInt& I = CI->getValue(); @@ -63,7 +66,7 @@ SVal ValueManager::convertToArrayIndex(SVal V) { return V; } - return SVator->EvalCast(V, ArrayIndexTy); + return SVator->EvalCastNL(cast<NonLoc>(V), ArrayIndexTy); } SVal ValueManager::getRegionValueSymbolVal(const MemRegion* R, QualType T) { |