dwarf2out.c (field_byte_offset): As with dwarfout.c, size can be zero if there was...
authorBrendan Kehoe <brendan@cygnus.com>
Mon, 6 Dec 1999 19:16:52 +0000 (19:16 +0000)
committerBrendan Kehoe <brendan@gcc.gnu.org>
Mon, 6 Dec 1999 19:16:52 +0000 (14:16 -0500)
    * dwarf2out.c (field_byte_offset): As with dwarfout.c, size can be
    zero if there was an error.

From-SVN: r30804

gcc/ChangeLog
gcc/dwarf2out.c

index 4880f039b092ba80a04dd2eff157cecbfba1f6b2..67a0376ec8f3505ad7f04ced7bc3defd12406e93 100644 (file)
@@ -1,3 +1,8 @@
+1999-12-06  Brendan Kehoe  <brendan@cygnus.com>
+
+       * dwarf2out.c (field_byte_offset): As with dwarfout.c, size can be
+       zero if there was an error.
+
 1999-12-06  Jakub Jelinek  <jakub@redhat.com>
 
        * config/sparc/sparc.md (return_losum_di): Fix typo in asm
index 0a8846999fa05c101306cb68c25e09e2bc57500c..4f8227c76a9dc2786262f2b2d9cf0ad062121337 100644 (file)
@@ -6695,6 +6695,14 @@ field_byte_offset (decl)
   bitpos_tree = DECL_FIELD_BITPOS (decl);
   field_size_tree = DECL_SIZE (decl);
 
+  /* If there was an error, the size could be zero.  */
+  if (! field_size_tree)
+    {
+      if (errorcount)
+       return 0;
+      abort ();
+    }
+
   /* We cannot yet cope with fields whose positions are variable, so 
      for now, when we see such things, we simply return 0.  Someday, we may
      be able to handle such cases, but it will be damn difficult.  */