diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-07-22 04:23:20 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-07-22 04:23:20 +0000 |
commit | 0b331e369695eef0ef7ce162602df4c2ace4412f (patch) | |
tree | 2fa87f4c3343c17acb21e365730a5f38df01a34a /lib/Analysis/Store.cpp | |
parent | c6a38a47bf3908ab2183d7946498138d8b07c886 (diff) |
Fix a crasher in StoreManager::InvalidateRegion() caused by using the
'cast type' of a region to invalidate its binding. This only occurs
when using RegionStoreManager, as it records the cast type. I'm
currently considering removing the notion of a cast type (see
comments in code).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76719 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/Store.cpp')
-rw-r--r-- | lib/Analysis/Store.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Analysis/Store.cpp b/lib/Analysis/Store.cpp index bd46a68d01..bddf05465a 100644 --- a/lib/Analysis/Store.cpp +++ b/lib/Analysis/Store.cpp @@ -258,6 +258,13 @@ const GRState *StoreManager::InvalidateRegion(const GRState *state, const TypedRegion *TR = cast<TypedRegion>(R); QualType T = TR->getValueType(Ctx); + // FIXME: The code causes a crash when using RegionStore on the test case + // 'test_invalidate_cast_int' (misc-ps.m). Consider removing it + // permanently. Region casts are probably not too strict to handle + // the transient interpretation of memory. Instead we can use the QualType + // passed to 'Retrieve' and friends to determine the most current + // interpretation of memory when it is actually used. +#if 0 // If the region is cast to another type, use that type. if (const QualType *CastTy = getCastType(state, R)) { assert(!(*CastTy)->isObjCObjectPointerType()); @@ -270,6 +277,7 @@ const GRState *StoreManager::InvalidateRegion(const GRState *state, if (!(Loc::IsLocType(T) && !Loc::IsLocType(NewT))) T = NewT; } +#endif if (Loc::IsLocType(T) || (T->isIntegerType() && T->isScalarType())) { SVal V = ValMgr.getConjuredSymbolVal(E, T, Count); |