diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-08-02 04:56:14 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-08-02 04:56:14 +0000 |
commit | fd91d27630c6236f13a3da1a79db22ede762a212 (patch) | |
tree | ad1408f33e34c55564d895cba967c9c02566a039 /clang/lib/Checker/RegionStore.cpp | |
parent | 460ad41d6d2e6af29d11b3e16345123503da19c4 (diff) | |
download | bcm5719-llvm-fd91d27630c6236f13a3da1a79db22ede762a212.tar.gz bcm5719-llvm-fd91d27630c6236f13a3da1a79db22ede762a212.zip |
Improve flat store: MemRegion::getAsOffset() computes a region's offset within
the top-level object. FlatStore now can bind and retrieve element and field
regions.
PR7297 is fixed by flat store.
llvm-svn: 110020
Diffstat (limited to 'clang/lib/Checker/RegionStore.cpp')
-rw-r--r-- | clang/lib/Checker/RegionStore.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Checker/RegionStore.cpp b/clang/lib/Checker/RegionStore.cpp index 5dd824e7720..f7e19f6f510 100644 --- a/clang/lib/Checker/RegionStore.cpp +++ b/clang/lib/Checker/RegionStore.cpp @@ -1146,7 +1146,7 @@ SVal RegionStoreManager::RetrieveElement(Store store, // char *y = &x; // return *y; // FIXME: This is a hack, and doesn't do anything really intelligent yet. - const RegionRawOffset &O = R->getAsRawOffset(); + const RegionRawOffset &O = R->getAsArrayOffset(); if (const TypedRegion *baseR = dyn_cast_or_null<TypedRegion>(O.getRegion())) { QualType baseT = baseR->getValueType(Ctx); if (baseT->isScalarType()) { @@ -1608,7 +1608,7 @@ Store RegionStoreManager::CopyLazyBindings(nonloc::LazyCompoundVal V, BindingKey BindingKey::Make(const MemRegion *R, Kind k) { if (const ElementRegion *ER = dyn_cast<ElementRegion>(R)) { - const RegionRawOffset &O = ER->getAsRawOffset(); + const RegionRawOffset &O = ER->getAsArrayOffset(); if (O.getRegion()) return BindingKey(O.getRegion(), O.getByteOffset(), k); |