[cfe-commits] r122494 - /cfe/trunk/lib/EntoSA/RegionStore.cpp
Zhongxing Xu
xuzhongxing at gmail.com
Thu Dec 23 04:08:43 PST 2010
Author: zhongxingxu
Date: Thu Dec 23 06:08:42 2010
New Revision: 122494
URL: http://llvm.org/viewvc/llvm-project?rev=122494&view=rev
Log:
When cast derived to base, only process MemRegionVal.
Modified:
cfe/trunk/lib/EntoSA/RegionStore.cpp
Modified: cfe/trunk/lib/EntoSA/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/EntoSA/RegionStore.cpp?rev=122494&r1=122493&r2=122494&view=diff
==============================================================================
--- cfe/trunk/lib/EntoSA/RegionStore.cpp (original)
+++ cfe/trunk/lib/EntoSA/RegionStore.cpp Thu Dec 23 06:08:42 2010
@@ -817,9 +817,12 @@
assert(baseDecl && "not a CXXRecordDecl?");
- loc::MemRegionVal &derivedRegVal = cast<loc::MemRegionVal>(derived);
+ loc::MemRegionVal *derivedRegVal = dyn_cast<loc::MemRegionVal>(&derived);
+ if (!derivedRegVal)
+ return derived;
+
const MemRegion *baseReg =
- MRMgr.getCXXBaseObjectRegion(baseDecl, derivedRegVal.getRegion());
+ MRMgr.getCXXBaseObjectRegion(baseDecl, derivedRegVal->getRegion());
return loc::MemRegionVal(baseReg);
}
//===----------------------------------------------------------------------===//
More information about the cfe-commits
mailing list