ElementRegions that have non-zero array indices.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70867
91177308-0d34-0410-b5e6-
96231b3b80d8
case loc::MemRegionKind: {
const MemRegion *R = cast<loc::MemRegionVal>(BaseL).getRegion();
- if (isa<ElementRegion>(R)) {
+ if (const ElementRegion *ER = dyn_cast<ElementRegion>(R)) {
// int x;
// char* y = (char*) &x;
// 'y' => ElementRegion(0, VarRegion('x'))
// y[0] = 'a';
+ assert(ER->getIndex().isUnknown() ||
+ cast<nonloc::ConcreteInt>(ER->getIndex()).getValue() == 0);
+ ER = ER; // silence 'unused' warning in release modes.
return Base;
}