From 8348547afcc43bea152a4890d85b3132ba6bfb3c Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Wed, 8 Sep 1993 10:36:19 +0000 Subject: [PATCH] (output_init_element): When adding to constructor_pending_elts, copy field. From-SVN: r5281 --- gcc/c-typeck.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 40207c4404e..db66823719c 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -5822,8 +5822,10 @@ output_init_element (value, type, field, pending) && !tree_int_cst_equal (field, constructor_unfilled_index)) { if (! duplicate) + /* The copy_node is needed in case field is actually + constructor_index, which is modified in place. */ constructor_pending_elts - = tree_cons (field, + = tree_cons (copy_node (field), digest_init (type, value, 0, 0), constructor_pending_elts); } -- 2.30.2