aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/RegionStore.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2008-10-27 09:24:07 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2008-10-27 09:24:07 +0000
commit8fe63af0bd8feba4034848211e4e250e1c9ef302 (patch)
tree62dfeb733872069ae3d3810be776f07b9b660002 /lib/Analysis/RegionStore.cpp
parent92429ddd879d22bb4d18e142ef0ff82d455f9be8 (diff)
Get the canonical type for struct initialization. The original code would crash on TypedefType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58236 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/RegionStore.cpp')
-rw-r--r--lib/Analysis/RegionStore.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp
index 0a31bc8f5d..536e14944b 100644
--- a/lib/Analysis/RegionStore.cpp
+++ b/lib/Analysis/RegionStore.cpp
@@ -233,6 +233,9 @@ SVal RegionStoreManager::Retrieve(Store S, Loc L, QualType T) {
}
Store RegionStoreManager::Bind(Store store, Loc LV, SVal V) {
+ if (LV.getSubKind() == loc::SymbolValKind)
+ return store;
+
assert(LV.getSubKind() == loc::MemRegionKind);
const MemRegion* R = cast<loc::MemRegionVal>(LV).getRegion();
@@ -373,7 +376,8 @@ Store RegionStoreManager::InitializeArrayToUndefined(Store store, QualType T,
Store RegionStoreManager::InitializeStructToUndefined(Store store, QualType T,
MemRegion* BaseR) {
- const RecordType* RT = cast<RecordType>(T.getTypePtr());
+ QualType CT = T->getCanonicalTypeInternal();
+ const RecordType* RT = cast<RecordType>(CT.getTypePtr());
RecordDecl* RD = RT->getDecl();
assert(RD->isDefinition());