aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-06-22 23:58:31 +0000
committerTed Kremenek <kremenek@apple.com>2010-06-22 23:58:31 +0000
commit3f8612b46949a73729ef0e0d985cc8cce1ec096f (patch)
tree696efdf13381e74ba1aaae6bdcc156905d89a6e7 /lib/Checker
parent1984eb9a1522ad56e1310643a85f66b2b3424c91 (diff)
Correctly construct an ElementRegion for alloca() + pointer arithmetic. Fixes analyzer
crash reported in PR 7450. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106609 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker')
-rw-r--r--lib/Checker/RegionStore.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Checker/RegionStore.cpp b/lib/Checker/RegionStore.cpp
index 6f8c2504bd..a9d12dfb4a 100644
--- a/lib/Checker/RegionStore.cpp
+++ b/lib/Checker/RegionStore.cpp
@@ -883,8 +883,7 @@ SVal RegionStoreManager::EvalBinOp(BinaryOperator::Opcode Op, Loc L, NonLoc R,
}
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;