re PR debug/49262 (3-yr-old infinite loop in dwarf2out.c)
authorJakub Jelinek <jakub@redhat.com>
Mon, 6 Jun 2011 17:46:00 +0000 (19:46 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 6 Jun 2011 17:46:00 +0000 (19:46 +0200)
PR debug/49262
* dwarf2out.c (native_encode_initializer): Decrement count in each
iteration.

From-SVN: r174715

gcc/ChangeLog
gcc/dwarf2out.c

index 967371c09f339e58ee36832eccada2b718bae8a7..a4164a3eabfbdad07ffa226c4bb2b350a6a27d77 100644 (file)
@@ -1,5 +1,9 @@
 2011-06-06  Jakub Jelinek  <jakub@redhat.com>
 
+       PR debug/49262
+       * dwarf2out.c (native_encode_initializer): Decrement count in each
+       iteration.
+
        PR debug/49294
        * dwarf2out.c (mem_loc_descriptor) <do_shift>: Give up for
        non-MODE_INT modes.
index 0fa7f91fa17e803a2c757589abfde1fa4d3099c4..776066b275c905596a1b791e7841c73b0b69146e 100644 (file)
@@ -18065,7 +18065,7 @@ native_encode_initializer (tree init, unsigned char *array, int size)
                {
                  int count = tree_low_cst (TREE_OPERAND (index, 1), 0)
                              - tree_low_cst (TREE_OPERAND (index, 0), 0);
-                 while (count > 0)
+                 while (count-- > 0)
                    {
                      if (val)
                        memcpy (array + curpos, array + pos, fieldsize);