Fix a serious bug in RegionStore: we got the new state with new store from

Bind() and BindStruct(), but we returned a state with the old store.

llvm-svn: 66409
This commit is contained in:
Zhongxing Xu 2009-03-09 06:49:50 +00:00
parent e3193ff452
commit b09280bcc0
1 changed files with 2 additions and 4 deletions

View File

@ -1046,8 +1046,6 @@ const GRState* RegionStoreManager::BindArray(const GRState* St,
St = state.set<RegionDefaultValue>(R, NonLoc::MakeIntVal(getBasicVals(), 0, St = state.set<RegionDefaultValue>(R, NonLoc::MakeIntVal(getBasicVals(), 0,
false)); false));
Store store = St->getStore();
ConstantArrayType* CAT = cast<ConstantArrayType>(T.getTypePtr()); ConstantArrayType* CAT = cast<ConstantArrayType>(T.getTypePtr());
llvm::APSInt Size(CAT->getSize(), false); llvm::APSInt Size(CAT->getSize(), false);
@ -1076,7 +1074,7 @@ const GRState* RegionStoreManager::BindArray(const GRState* St,
St = Bind(St, loc::MemRegionVal(ER), V); St = Bind(St, loc::MemRegionVal(ER), V);
} }
return StateMgr.MakeStateWithStore(St, store); return St;
} }
@ -1098,7 +1096,7 @@ const GRState* RegionStoreManager::BindArray(const GRState* St,
St = Bind(St, Loc::MakeVal(ER), *VI); St = Bind(St, Loc::MakeVal(ER), *VI);
} }
return StateMgr.MakeStateWithStore(St, store); return St;
} }
const GRState* const GRState*