From 99a5e049bad4d20dc10a9934cac65102b6b82977 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 6 Jun 2011 19:46:00 +0200 Subject: [PATCH] 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 --- gcc/ChangeLog | 4 ++++ gcc/dwarf2out.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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); -- 2.30.2