@@ -15279,16 +15279,26 @@ it is a tpck_unknown_function constant and to NULL otherwise.
1527915279} /* is_dot_static_operation */
1528015280
1528115281
15282- static void gen_array_subscript (an_expr_node_ptr expr)
15282+ static void gen_array_subscript_list (an_expr_node_ptr expr)
1528315283/*
15284- Render the given expression surrounded by brackets.
15284+ Put out the given expression list surrounded by square brackets.
1528515285*/
1528615286{
15287+ a_boolean first = TRUE;
15288+
1528715289 write_tok_ch('[');
15288- gen_expr(expr, /*need_parens=*/expr_has_comma_operation(expr),
15289- /*obj_expr_of_mfunc_operator=*/FALSE);
15290+ while (expr != NULL) {
15291+ if (first) {
15292+ first = FALSE;
15293+ } else {
15294+ write_tok_str(", ");
15295+ } /* if */
15296+ gen_expr(expr, /*need_parens=*/expr_has_comma_operation(expr),
15297+ /*obj_expr_of_mfunc_operator=*/FALSE);
15298+ expr = expr->next;
15299+ } /* if */
1529015300 write_tok_ch(']');
15291- } /* gen_array_subscript */
15301+ } /* gen_array_subscript_list */
1529215302
1529315303
1529415304static void gen_va_arg(an_expr_node_ptr expr)
@@ -17876,7 +17886,7 @@ handled through recursion.
1787617886 break;
1787717887 case eok_subscript:
1787817888 gen_member_selector_for_builtin_offsetof(arg1);
17879- gen_array_subscript (arg2);
17889+ gen_array_subscript_list (arg2);
1788017890 break;
1788117891 case eok_cast:
1788217892 case eok_base_class_cast:
@@ -19269,7 +19279,7 @@ gen_expr that might end up generating this expr as a temporary.
1926919279 parens_may_be_needed(generated_precedence[eok_subscript],
1927019280 operand_1),
1927119281 /*obj_expr_of_mfunc_operator=*/FALSE);
19272- gen_array_subscript (operand_2);
19282+ gen_array_subscript_list (operand_2);
1927319283 goto done_with_operation;
1927419284 case eok_cli_subscript:
1927519285 gen_expr_with_parens(operand_1);
0 commit comments