summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Analysis/RegionStore.cpp2
-rw-r--r--clang/test/Analysis/misc-ps-region-store.m3
2 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp
index 31f52a55b3d..75907da55ec 100644
--- a/clang/lib/Analysis/RegionStore.cpp
+++ b/clang/lib/Analysis/RegionStore.cpp
@@ -1322,7 +1322,7 @@ const GRState *RegionStoreManager::Bind(const GRState *state, Loc L, SVal V) {
// Binding directly to a symbolic region should be treated as binding
// to element 0.
QualType T = SR->getSymbol()->getType(getContext());
- T = cast<PointerType>(T)->getPointeeType();
+ T = T->getAs<PointerType>()->getPointeeType();
R = GetElementZeroRegion(SR, T);
}
diff --git a/clang/test/Analysis/misc-ps-region-store.m b/clang/test/Analysis/misc-ps-region-store.m
index 569fc790d63..c5be02c821f 100644
--- a/clang/test/Analysis/misc-ps-region-store.m
+++ b/clang/test/Analysis/misc-ps-region-store.m
@@ -198,7 +198,8 @@ CGFloat rdar7242006_negative(CGFloat x) {
// <rdar://problem/7249340> - Allow binding of values to symbolic regions.
// This test case shows how RegionStore tracks the value bound to 'x'
// after the assignment.
-void rdar_7249340(int *x) {
+typedef int* ptr_rdar_7249340;
+void rdar_7249340(ptr_rdar_7249340 x) {
*x = 1;
if (*x)
return;
OpenPOWER on IntegriCloud