OSDN Git Service

2008-03-25 Andrew Pinski <pinskia@gmail.com>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Mar 2008 03:19:58 +0000 (03:19 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Mar 2008 03:19:58 +0000 (03:19 +0000)
        PR objc/29197
        * objc-act.c (encode_type): Handle when type is error_mark_node.
        (objc_push_parm): Handle when the type of parm is error_mark_node.

2008-03-25  Andrew Pinski  <pinskia@gmail.com>

        PR objc/29197
        * objc.dg/method-20.m: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133540 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/objc/ChangeLog
gcc/objc/objc-act.c
gcc/testsuite/ChangeLog
gcc/testsuite/objc.dg/method-20.m [new file with mode: 0644]

index b558eb6..7584ed1 100644 (file)
@@ -1,3 +1,9 @@
+2008-03-25  Andrew Pinski  <pinskia@gmail.com>
+
+       PR objc/29197
+       * objc-act.c (encode_type): Handle when type is error_mark_node.
+       (objc_push_parm): Handle when the type of parm is error_mark_node.
+
 2008-03-25  Tom Tromey  <tromey@redhat.com>
 
        * Make-lang.in (objc_OBJS): New variable.
 2008-03-25  Tom Tromey  <tromey@redhat.com>
 
        * Make-lang.in (objc_OBJS): New variable.
index 576e569..48bf974 100644 (file)
@@ -8075,6 +8075,9 @@ encode_type (tree type, int curtype, int format)
   enum tree_code code = TREE_CODE (type);
   char c;
 
   enum tree_code code = TREE_CODE (type);
   char c;
 
+  if (type == error_mark_node)
+    return;
+
   if (TYPE_READONLY (type))
     obstack_1grow (&util_obstack, 'r');
 
   if (TYPE_READONLY (type))
     obstack_1grow (&util_obstack, 'r');
 
@@ -8231,6 +8234,13 @@ static void
 objc_push_parm (tree parm)
 {
   bool relayout_needed = false;
 objc_push_parm (tree parm)
 {
   bool relayout_needed = false;
+
+  if (TREE_TYPE (parm) == error_mark_node)
+    {
+      objc_parmlist = chainon (objc_parmlist, parm);
+      return;
+    }
+
   /* Decay arrays and functions into pointers.  */
   if (TREE_CODE (TREE_TYPE (parm)) == ARRAY_TYPE)
     {
   /* Decay arrays and functions into pointers.  */
   if (TREE_CODE (TREE_TYPE (parm)) == ARRAY_TYPE)
     {
index 79c4693..8ba4e6e 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-25  Andrew Pinski  <pinskia@gmail.com>
+
+       PR objc/29197
+       * objc.dg/method-20.m: New testcase.
+       
 2008-03-25  Richard Sandiford  <rsandifo@nildram.co.uk>
 
        PR rtl-optimization/35232
 2008-03-25  Richard Sandiford  <rsandifo@nildram.co.uk>
 
        PR rtl-optimization/35232
diff --git a/gcc/testsuite/objc.dg/method-20.m b/gcc/testsuite/objc.dg/method-20.m
new file mode 100644 (file)
index 0000000..653e047
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do compile }  */
+
+/* We used to crash after we found the type for int[m] was declared as invalid. */
+/* PR objc/29197 */
+
+@ implementation NGActiveSocket
++ (void) socketPair:(int[m]) _pair {} /* { dg-error "" } */
+@end