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 | b2d0409d5054e7e21173935d13eaf16a7655bb82 (patch) | |
| tree | 60b9da62897b5011dacc775dcd0b64df709fb117 /clang/lib/Analysis | |
| parent | 6bad1376a24fd83b7d125c7c4a713b6eede0805f (diff) | |
| download | bcm5719-llvm-b2d0409d5054e7e21173935d13eaf16a7655bb82.tar.gz bcm5719-llvm-b2d0409d5054e7e21173935d13eaf16a7655bb82.zip | |
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).
llvm-svn: 76719
Diffstat (limited to 'clang/lib/Analysis')
| -rw-r--r-- | clang/lib/Analysis/Store.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Analysis/Store.cpp b/clang/lib/Analysis/Store.cpp index bd46a68d013..bddf05465af 100644 --- a/clang/lib/Analysis/Store.cpp +++ b/clang/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); |

