Revert r75281 and simply remove the assertion in NewCastRegion that
CodeTextRegions can only be casted to FunctionPointer or BlockPointerTypes. This
simply isn't true. We can handle bogus operations on CodeTextRegions (e.g, an
array access) elsewhere.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75285 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Analysis/misc-ps.m b/test/Analysis/misc-ps.m
index 19d7622..a0da13e 100644
--- a/test/Analysis/misc-ps.m
+++ b/test/Analysis/misc-ps.m
@@ -324,17 +324,20 @@
   if (x == ((void*) 0)) {}
 }
 
-// Handle arbitrary void*^n -> void*^m casts.  This was previously causing
-// a crash in CastRegion.
-void handle_higher_order_voidptr_casts() {
+// Handle casts of function pointers (CodeTextRegions) to arbitrary pointer
+// types. This was previously causing a crash in CastRegion.
+void handle_funcptr_voidptr_casts() {
   void **ptr;
   typedef void *PVOID;
+  typedef void *PCHAR;  
   typedef long INT_PTR, *PINT_PTR;
   typedef INT_PTR (*FARPROC)();
-  FARPROC handle_higher_order_voidptr_casts_aux();
-  PVOID handle_higher_order_voidptr_casts_aux_2(PVOID volatile *x);
+  FARPROC handle_funcptr_voidptr_casts_aux();
+  PVOID handle_funcptr_voidptr_casts_aux_2(PVOID volatile *x);
+  PVOID handle_funcptr_voidptr_casts_aux_3(PCHAR volatile *x);  
   
-  ptr = (void**) handle_higher_order_voidptr_casts_aux();
-  handle_higher_order_voidptr_casts_aux_2(ptr);
+  ptr = (void**) handle_funcptr_voidptr_casts_aux();
+  handle_funcptr_voidptr_casts_aux_2(ptr);
+  handle_funcptr_voidptr_casts_aux_3(ptr);
 }