diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-11-16 04:49:44 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-11-16 04:49:44 +0000 |
commit | 652be346f74feba027bcbdeb6a3e3f4755a0e62c (patch) | |
tree | 7ac0e7954d742066961437ffac9fa882da4a7dca /lib/Analysis/BasicStore.cpp | |
parent | 7f92f0362ef2cf218bc19bb83e1a97dd254b5527 (diff) |
* Do the same thing to the basicstore as in r84163.
* Add a load type to GRExprEngine::EvalLoad().
* When retrieve from 'theValue' of OSAtomic funcitions, use the type of the
region instead of the argument expression as the load type.
* Then we can convert CastRetrievedSVal to a pure assertion. In the future
we can let all Retrieve() methods simply return SVal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88888 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/BasicStore.cpp')
-rw-r--r-- | lib/Analysis/BasicStore.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/lib/Analysis/BasicStore.cpp b/lib/Analysis/BasicStore.cpp index 7a36a3ee08..800a76fb0a 100644 --- a/lib/Analysis/BasicStore.cpp +++ b/lib/Analysis/BasicStore.cpp @@ -268,20 +268,6 @@ SValuator::CastResult BasicStoreManager::Retrieve(const GRState *state, case loc::MemRegionKind: { const MemRegion* R = cast<loc::MemRegionVal>(loc).getRegion(); - if (const ElementRegion *ER = dyn_cast<ElementRegion>(R)) { - // Just support void**, void***, intptr_t*, intptr_t**, etc., for now. - // This is needed to handle OSCompareAndSwapPtr() and friends. - ASTContext &Ctx = StateMgr.getContext(); - QualType T = ER->getLocationType(Ctx); - - if (!isHigherOrderRawPtr(T, Ctx)) - return SValuator::CastResult(state, UnknownVal()); - - // FIXME: Should check for element 0. - // Otherwise, strip the element region. - R = ER->getSuperRegion(); - } - if (!(isa<VarRegion>(R) || isa<ObjCIvarRegion>(R))) return SValuator::CastResult(state, UnknownVal()); @@ -291,7 +277,8 @@ SValuator::CastResult BasicStoreManager::Retrieve(const GRState *state, if (!Val) break; - return CastRetrievedVal(*Val, state, cast<TypedRegion>(R), T); + return SValuator::CastResult(state, + CastRetrievedVal(*Val, cast<TypedRegion>(R), T)); } case loc::ConcreteIntKind: |