From: Jakub Jelinek Date: Mon, 6 Jun 2011 17:46:00 +0000 (+0200) Subject: re PR debug/49262 (3-yr-old infinite loop in dwarf2out.c) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=99a5e049bad4d20dc10a9934cac65102b6b82977;p=gcc.git re PR debug/49262 (3-yr-old infinite loop in dwarf2out.c) PR debug/49262 * dwarf2out.c (native_encode_initializer): Decrement count in each iteration. From-SVN: r174715 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 967371c09f3..a4164a3eabf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2011-06-06 Jakub Jelinek + PR debug/49262 + * dwarf2out.c (native_encode_initializer): Decrement count in each + iteration. + PR debug/49294 * dwarf2out.c (mem_loc_descriptor) : Give up for non-MODE_INT modes. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 0fa7f91fa17..776066b275c 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -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);