[llvm-commits] [llvm-gcc-4.2] r117091 - in /llvm-gcc-4.2/trunk/gcc: cp/decl.c testsuite/g++.apple/block-blocks-test-7.C

Bob Wilson bob.wilson at apple.com
Thu Oct 21 21:52:38 PDT 2010


Author: bwilson
Date: Thu Oct 21 23:52:38 2010
New Revision: 117091

URL: http://llvm.org/viewvc/llvm-project?rev=117091&view=rev
Log:
Radar 8503773. Patch from Fariborz to fix block-related crash.

Modified:
    llvm-gcc-4.2/trunk/gcc/cp/decl.c
    llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-7.C

Modified: llvm-gcc-4.2/trunk/gcc/cp/decl.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/decl.c?rev=117091&r1=117090&r2=117091&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cp/decl.c (original)
+++ llvm-gcc-4.2/trunk/gcc/cp/decl.c Thu Oct 21 23:52:38 2010
@@ -11364,7 +11364,8 @@
   /* Build the return declaration for the function.  */
   restype = TREE_TYPE (fntype);
   /* Promote the value to int before returning it.  */
-  if (c_promoting_integer_type_p (restype))
+  /* APPLE LOCAL radar 8503773 */
+  if (!cur_block && c_promoting_integer_type_p (restype))
     restype = type_promotes_to (restype);
   if (DECL_RESULT (decl1) == NULL_TREE)
     {

Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-7.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-blocks-test-7.C?rev=117091&r1=117090&r2=117091&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-7.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-7.C Thu Oct 21 23:52:38 2010
@@ -39,4 +39,11 @@
    return 0;
 }
 
+/* APPLE LOCAL begin radar 8503773 */
+typedef char (^B) ();
+void foo (B);
 
+void MyFunc() {
+	^ bool () { return true; };
+}
+/* APPLE LOCAL end radar 8503773 */





More information about the llvm-commits mailing list