RegionStore: revert to the default value approach for array initialization.

llvm-svn: 74043
This commit is contained in:
Zhongxing Xu 2009-06-24 00:56:31 +00:00
parent a3d375845e
commit 9ef415edf2
1 changed files with 5 additions and 8 deletions

View File

@ -1127,15 +1127,12 @@ const GRState *RegionStoreManager::BindArray(const GRState *state,
state = Bind(state, ValMgr.makeLoc(ER), *VI);
}
// If the init list is shorter than the array length, bind the rest elements
// to 0.
if (ElementTy->isIntegerType()) {
while (i < Size) {
SVal Idx = ValMgr.makeIntVal(i);
ElementRegion* ER = MRMgr.getElementRegion(ElementTy, Idx,R,getContext());
// If the init list is shorter than the array length, set the array default
// value.
if (i < Size) {
if (ElementTy->isIntegerType()) {
SVal V = ValMgr.makeZeroVal(ElementTy);
state = Bind(state, ValMgr.makeLoc(ER), V);
++i;
state = setDefaultValue(state, R, V);
}
}