Improve comments.

llvm-svn: 111735
This commit is contained in:
Zhongxing Xu 2010-08-21 11:03:37 +00:00
parent 5cba6c85c9
commit e11f17f5ed
1 changed files with 1 additions and 6 deletions

View File

@ -1316,18 +1316,13 @@ Store RegionStoreManager::Bind(Store store, Loc L, SVal V) {
if (TR->getValueType()->isStructureOrClassType()) if (TR->getValueType()->isStructureOrClassType())
return BindStruct(store, TR, V); return BindStruct(store, TR, V);
// Special case: the current region represents a cast and it and the super
// region both have pointer types or intptr_t types. If so, perform the
// bind to the super region.
// This is needed to support OSAtomicCompareAndSwap and friends or other
// loads that treat integers as pointers and vis versa.
if (const ElementRegion *ER = dyn_cast<ElementRegion>(R)) { if (const ElementRegion *ER = dyn_cast<ElementRegion>(R)) {
if (ER->getIndex().isZeroConstant()) { if (ER->getIndex().isZeroConstant()) {
if (const TypedRegion *superR = if (const TypedRegion *superR =
dyn_cast<TypedRegion>(ER->getSuperRegion())) { dyn_cast<TypedRegion>(ER->getSuperRegion())) {
QualType superTy = superR->getValueType(); QualType superTy = superR->getValueType();
// For now, just invalidate the fields of the struct/union/class. // For now, just invalidate the fields of the struct/union/class.
// This is for test: undef-buffers.c // This is for test rdar_test_7185607 in misc-ps-region-store.m.
// FIXME: Precisely handle the fields of the record. // FIXME: Precisely handle the fields of the record.
if (superTy->isStructureOrClassType()) if (superTy->isStructureOrClassType())
return KillStruct(store, superR, UnknownVal()); return KillStruct(store, superR, UnknownVal());