crash reported in PR 7450.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106609
91177308-0d34-0410-b5e6-
96231b3b80d8
}
case MemRegion::AllocaRegionKind: {
const AllocaRegion *AR = cast<AllocaRegion>(MR);
- QualType T = getContext().CharTy; // Create an ElementRegion of bytes.
- QualType EleTy = T->getAs<PointerType>()->getPointeeType();
+ QualType EleTy = getContext().CharTy; // Create an ElementRegion of bytes.
SVal ZeroIdx = ValMgr.makeZeroArrayIndex();
ER = MRMgr.getElementRegion(EleTy, ZeroIdx, AR, getContext());
break;
return x;
}
+// PR 7450 - Handle pointer arithmetic with __builtin_alloca
+void pr_7450_aux(void *x);
+void pr_7450() {
+ void *p = __builtin_alloca(10);
+ // Don't crash when analyzing the following statement.
+ pr_7450_aux(p + 8);
+}
+