@@ -15289,16 +15289,26 @@ it is a tpck_unknown_function constant and to NULL otherwise.
1528915289} /* is_dot_static_operation */
1529015290
1529115291
15292- static void gen_array_subscript (an_expr_node_ptr expr)
15292+ static void gen_array_subscript_list (an_expr_node_ptr expr)
1529315293/*
15294- Render the given expression surrounded by brackets.
15294+ Put out the given expression list surrounded by square brackets.
1529515295*/
1529615296{
15297+ a_boolean first = TRUE;
15298+
1529715299 write_tok_ch('[');
15298- gen_expr(expr, /*need_parens=*/expr_has_comma_operation(expr),
15299- /*obj_expr_of_mfunc_operator=*/FALSE);
15300+ while (expr != NULL) {
15301+ if (first) {
15302+ first = FALSE;
15303+ } else {
15304+ write_tok_str(", ");
15305+ } /* if */
15306+ gen_expr(expr, /*need_parens=*/expr_has_comma_operation(expr),
15307+ /*obj_expr_of_mfunc_operator=*/FALSE);
15308+ expr = expr->next;
15309+ } /* if */
1530015310 write_tok_ch(']');
15301- } /* gen_array_subscript */
15311+ } /* gen_array_subscript_list */
1530215312
1530315313
1530415314static void gen_va_arg(an_expr_node_ptr expr)
@@ -17886,7 +17896,7 @@ handled through recursion.
1788617896 break;
1788717897 case eok_subscript:
1788817898 gen_member_selector_for_builtin_offsetof(arg1);
17889- gen_array_subscript (arg2);
17899+ gen_array_subscript_list (arg2);
1789017900 break;
1789117901 case eok_cast:
1789217902 case eok_base_class_cast:
@@ -19279,7 +19289,7 @@ gen_expr that might end up generating this expr as a temporary.
1927919289 parens_may_be_needed(generated_precedence[eok_subscript],
1928019290 operand_1),
1928119291 /*obj_expr_of_mfunc_operator=*/FALSE);
19282- gen_array_subscript (operand_2);
19292+ gen_array_subscript_list (operand_2);
1928319293 goto done_with_operation;
1928419294 case eok_cli_subscript:
1928519295 gen_expr_with_parens(operand_1);
0 commit comments