aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker/RegionStore.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2010-08-02 04:56:14 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2010-08-02 04:56:14 +0000
commit7caf9b369cba6edaf6eac25121cbc65ee938f14d (patch)
treec15958f4f67e8d3df28e928c7364dd09afee792b /lib/Checker/RegionStore.cpp
parent2fe238ed293bd4bc27af9beb9fa151fad2146fa8 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110020 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/RegionStore.cpp')
-rw-r--r--lib/Checker/RegionStore.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Checker/RegionStore.cpp b/lib/Checker/RegionStore.cpp
index 5dd824e772..f7e19f6f51 100644
--- a/lib/Checker/RegionStore.cpp
+++ b/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);