aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/RegionStore.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-06-13 01:31:11 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-06-13 01:31:11 +0000
commitf0ec39a99b543547609a36a1bca08836db7849a6 (patch)
treec2275c199ec5245d929bb3c63f29160ada10f7ea /lib/Analysis/RegionStore.cpp
parentc9e5d25ea33616c896a2ce5fbd6d68186eaddc5c (diff)
Stop tracking non-compound value for struct. It may be caused by imprecise cast
logic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73279 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/RegionStore.cpp')
-rw-r--r--lib/Analysis/RegionStore.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp
index 8ce37e6069..eae3aefe21 100644
--- a/lib/Analysis/RegionStore.cpp
+++ b/lib/Analysis/RegionStore.cpp
@@ -1198,8 +1198,10 @@ RegionStoreManager::BindStruct(const GRState* St, const TypedRegion* R, SVal V){
if (V.isUnknown())
return KillStruct(St, R);
- if (isa<nonloc::SymbolVal>(V))
- return setDefaultValue(St, R, V);
+ // We may get non-CompoundVal accidentally due to imprecise cast logic. Ignore
+ // them and make struct unknown.
+ if (!isa<nonloc::CompoundVal>(V))
+ return KillStruct(St, R);
nonloc::CompoundVal& CV = cast<nonloc::CompoundVal>(V);
nonloc::CompoundVal::iterator VI = CV.begin(), VE = CV.end();