]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
except.c (push_eh_info): Pass the number of fields - 1 down, not the exact number...
authorBrendan Kehoe <brendan@lisa.cygnus.com>
Fri, 31 Oct 1997 23:17:35 +0000 (23:17 +0000)
committerBrendan Kehoe <brendan@gcc.gnu.org>
Fri, 31 Oct 1997 23:17:35 +0000 (18:17 -0500)
        * except.c (push_eh_info): Pass the number of fields - 1 down, not
        the exact number of fields.

cuz in finish_builtin_type, its comment sez

   LEN is the number of elements
   in FIELDS minus one, or put another way, it is the maximum subscript
   used in FIELDS.

and its code does

  for (i = 0; i < len; i++)
    {
      layout_type (TREE_TYPE (fields[i]));
      DECL_FIELD_CONTEXT (fields[i]) = type;
      TREE_CHAIN (fields[i]) = fields[i+1];
    }
  DECL_FIELD_CONTEXT (fields[i]) = type;
  DECL_CLASS_CONTEXT (fields[i]) = type;

thus expecting the final ones to be fields[4], not fields[5] (which is
the actual size from 0, not the last field member)

From-SVN: r16257

gcc/cp/ChangeLog
gcc/cp/except.c

index 5ff066ab51bc8b277e135e538d86fedb99800e30..78df28f00150e9a1a9e735f4579552f68027f7ca 100644 (file)
@@ -1,3 +1,8 @@
+1997-10-31  Brendan Kehoe  <brendan@lisa.cygnus.com>
+
+       * except.c (push_eh_info): Pass the number of fields - 1 down, not
+       the exact number of fields.
+
 Fri Oct 31 01:47:57 1997  Jason Merrill  <jason@yorick.cygnus.com>
 
        Support for nested exceptions.
index 4d3622bde90f719ecd8fc6a191ffbf2ccf673e0f..cb59774728ac302bad3c66373921b40f907032e5 100644 (file)
@@ -342,7 +342,9 @@ push_eh_info ()
                                         boolean_type_node);
       fields[4] = build_lang_field_decl (FIELD_DECL, get_identifier ("next"),
                                         build_pointer_type (t));
-      finish_builtin_type (t, "cp_eh_info", fields, 5, ptr_type_node);
+      /* N.B.: The fourth field LEN is expected to be
+        the number of fields - 1, not the total number of fields.  */
+      finish_builtin_type (t, "cp_eh_info", fields, 4, ptr_type_node);
       t = build_pointer_type (t);
 
       /* And now the function.  */