Commit 83b091c7 by Richard Henderson Committed by Richard Henderson

c-typeck.c (add_pending_init): Don't abort for multiple fields at the same offset.

        * c-typeck.c (add_pending_init): Don't abort for multiple
        fields at the same offset.
        (pending_init_member): Test the correct member.

From-SVN: r32076
parent 4a6cfa63
2000-02-19 Richard Henderson <rth@cygnus.com>
* c-typeck.c (add_pending_init): Don't abort for multiple
fields at the same offset.
(pending_init_member): Test the correct member.
2000-02-19 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl> 2000-02-19 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
* except.c (start_dynamic_handler) : Use TYPE_MODE (integer_type_node) * except.c (start_dynamic_handler) : Use TYPE_MODE (integer_type_node)
......
...@@ -5580,7 +5580,7 @@ add_pending_init (purpose, value) ...@@ -5580,7 +5580,7 @@ add_pending_init (purpose, value)
p = *q; p = *q;
if (tree_int_cst_lt (purpose, p->purpose)) if (tree_int_cst_lt (purpose, p->purpose))
q = &p->left; q = &p->left;
else if (tree_int_cst_lt (p->purpose, purpose)) else if (p->purpose != purpose)
q = &p->right; q = &p->right;
else else
abort (); abort ();
...@@ -5594,8 +5594,7 @@ add_pending_init (purpose, value) ...@@ -5594,8 +5594,7 @@ add_pending_init (purpose, value)
if (tree_int_cst_lt (DECL_FIELD_BITPOS (purpose), if (tree_int_cst_lt (DECL_FIELD_BITPOS (purpose),
DECL_FIELD_BITPOS (p->purpose))) DECL_FIELD_BITPOS (p->purpose)))
q = &p->left; q = &p->left;
else if (tree_int_cst_lt (DECL_FIELD_BITPOS (p->purpose), else if (p->purpose != purpose)
DECL_FIELD_BITPOS (purpose)))
q = &p->right; q = &p->right;
else else
abort (); abort ();
...@@ -5780,7 +5779,7 @@ pending_init_member (field) ...@@ -5780,7 +5779,7 @@ pending_init_member (field)
{ {
while (p) while (p)
{ {
if (tree_int_cst_equal (field, p->purpose)) if (field == p->purpose)
return 1; return 1;
else if (tree_int_cst_lt (field, p->purpose)) else if (tree_int_cst_lt (field, p->purpose))
p = p->left; p = p->left;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment