Index: lib/StaticAnalyzer/Checkers/MallocChecker.cpp
===================================================================
--- lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+++ lib/StaticAnalyzer/Checkers/MallocChecker.cpp
@@ -1124,7 +1124,7 @@
                  ->getAs<SubRegion>();
   } else {
     ElementCount = svalBuilder.makeIntVal(1, true);
-    Region = Target.getAsRegion()->getAs<SubRegion>();
+    Region = cast<SubRegion>(Target.getAsRegion()->StripCasts());
   }
   assert(Region);
 
Index: test/Analysis/out-of-bounds-new.cpp
===================================================================
--- test/Analysis/out-of-bounds-new.cpp
+++ test/Analysis/out-of-bounds-new.cpp
@@ -1,4 +1,5 @@
 // RUN: %clang_analyze_cc1 -std=c++11 -Wno-array-bounds -analyzer-checker=unix,core,alpha.security.ArrayBoundV2 -verify %s
+// RUN: %clang_analyze_cc1 -std=c++11 -Wno-array-bounds -analyzer-checker=unix,core,alpha.security.ArrayBoundV2 -analyzer-config c++-allocator-inlining=true -verify %s
 
 // Tests doing an out-of-bounds access after the end of an array using:
 // - constant integer index