From: ceriel Date: Mon, 9 Aug 1993 09:40:44 +0000 (+0000) Subject: Fixed bug with union initializers X-Git-Tag: release-5-5~308 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=b3863b7247c7197529c5234302cf468113a0cbff;p=ack.git Fixed bug with union initializers --- diff --git a/lang/cem/cemcom.ansi/ival.g b/lang/cem/cemcom.ansi/ival.g index 05b2c42d8..4296be953 100644 --- a/lang/cem/cemcom.ansi/ival.g +++ b/lang/cem/cemcom.ansi/ival.g @@ -188,7 +188,7 @@ arr_elem(tpp, p) p->nelem = 1; return tpp; } - if (AHEAD == '{' || ! aggregate_type(tp->tp_up)) + if (AHEAD == '{' || (! aggregate_type(tp->tp_up) && tp->tp_up->tp_fund != UNION)) return &(tp->tp_up); return gen_tphead(&(tp->tp_up), 1); } @@ -219,6 +219,9 @@ gen_tphead(tpp, nest) return 0; } if (gen_error) return tpp; + if (tp->tp_fund == UNION) { + return gen_tphead(&(tp->tp_sdef->sd_type), nest); + } p = new_e_stack(); p->next = p_stack; p_stack = p;