[cfe-commits] r58236 - /cfe/trunk/lib/Analysis/RegionStore.cpp
Zhongxing Xu
xuzhongxing at gmail.com
Mon Oct 27 02:24:07 PDT 2008
Author: zhongxingxu
Date: Mon Oct 27 04:24:07 2008
New Revision: 58236
URL: http://llvm.org/viewvc/llvm-project?rev=58236&view=rev
Log:
Get the canonical type for struct initialization. The original code would crash on TypedefType.
Modified:
cfe/trunk/lib/Analysis/RegionStore.cpp
Modified: cfe/trunk/lib/Analysis/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/RegionStore.cpp?rev=58236&r1=58235&r2=58236&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/RegionStore.cpp (original)
+++ cfe/trunk/lib/Analysis/RegionStore.cpp Mon Oct 27 04:24:07 2008
@@ -233,6 +233,9 @@
}
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::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());
More information about the cfe-commits
mailing list