Stop tracking non-compound value for struct. It may be caused by imprecise cast

logic.

llvm-svn: 73279
This commit is contained in:
Zhongxing Xu 2009-06-13 01:31:11 +00:00
parent 4f024b2046
commit 70b27e6f8b
1 changed files with 4 additions and 2 deletions

View File

@ -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();