From: ceriel Date: Fri, 17 Nov 1989 11:36:43 +0000 (+0000) Subject: fixed bug which caused memory faults on erroneous input X-Git-Tag: release-5-5~2070 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=b6c29b55415db78213d59f32056f6a0c9eed1456;p=ack.git fixed bug which caused memory faults on erroneous input --- diff --git a/lang/cem/cemcom.ansi/ival.g b/lang/cem/cemcom.ansi/ival.g index fdee44a41..38a2e9d0b 100644 --- a/lang/cem/cemcom.ansi/ival.g +++ b/lang/cem/cemcom.ansi/ival.g @@ -93,6 +93,7 @@ initial_value_pack(struct type **tpp; struct expr **expp;) initial_value_list(register struct type **tpp; struct expr **expp;) { struct expr *e1; register struct type **tpp2 = 0; + int err_flag = gen_error; } : { if (tpp) tpp2 = gen_tphead(tpp, 0); } @@ -104,7 +105,7 @@ initial_value_list(register struct type **tpp; struct expr **expp;) initial_value(tpp2, &e1) { if (!tpp) init_expression(&expp, e1); } ]* - { if (tpp) gen_tpend(); } + { if (tpp && ! err_flag) gen_tpend(); } ','? /* optional trailing comma */ ;