summaryrefslogtreecommitdiffstats
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
commitbb18b57f53d0fce5a9d41459af5903a5e1fb65da (patch)
tree4a84c1be6472937d92fe8c05e7eb10a5291ab079
parentb32af436dfb99851b1bfade03edd964a01bc8da5 (diff)
downloadbcm5719-llvm-bb18b57f53d0fce5a9d41459af5903a5e1fb65da.tar.gz
bcm5719-llvm-bb18b57f53d0fce5a9d41459af5903a5e1fb65da.zip
Get the canonical type for struct initialization. The original code would crash on TypedefType.
llvm-svn: 58236
-rw-r--r--clang/lib/Analysis/RegionStore.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp
index 0a31bc8f5d7..536e14944b6 100644
--- a/clang/lib/Analysis/RegionStore.cpp
+++ b/clang/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());
OpenPOWER on IntegriCloud