@@ -15255,16 +15255,26 @@ it is a tpck_unknown_function constant and to NULL otherwise.
1525515255} /* is_dot_static_operation */
1525615256
1525715257
15258- static void gen_array_subscript (an_expr_node_ptr expr)
15258+ static void gen_array_subscript_list (an_expr_node_ptr expr)
1525915259/*
15260- Render the given expression surrounded by brackets.
15260+ Put out the given expression list surrounded by square brackets.
1526115261*/
1526215262{
15263+ a_boolean first = TRUE;
15264+
1526315265 write_tok_ch('[');
15264- gen_expr(expr, /*need_parens=*/expr_has_comma_operation(expr),
15265- /*obj_expr_of_mfunc_operator=*/FALSE);
15266+ while (expr != NULL) {
15267+ if (first) {
15268+ first = FALSE;
15269+ } else {
15270+ write_tok_str(", ");
15271+ } /* if */
15272+ gen_expr(expr, /*need_parens=*/expr_has_comma_operation(expr),
15273+ /*obj_expr_of_mfunc_operator=*/FALSE);
15274+ expr = expr->next;
15275+ } /* if */
1526615276 write_tok_ch(']');
15267- } /* gen_array_subscript */
15277+ } /* gen_array_subscript_list */
1526815278
1526915279
1527015280static void gen_va_arg(an_expr_node_ptr expr)
@@ -17852,7 +17862,7 @@ handled through recursion.
1785217862 break;
1785317863 case eok_subscript:
1785417864 gen_member_selector_for_builtin_offsetof(arg1);
17855- gen_array_subscript (arg2);
17865+ gen_array_subscript_list (arg2);
1785617866 break;
1785717867 case eok_cast:
1785817868 case eok_base_class_cast:
@@ -19245,7 +19255,7 @@ gen_expr that might end up generating this expr as a temporary.
1924519255 parens_may_be_needed(generated_precedence[eok_subscript],
1924619256 operand_1),
1924719257 /*obj_expr_of_mfunc_operator=*/FALSE);
19248- gen_array_subscript (operand_2);
19258+ gen_array_subscript_list (operand_2);
1924919259 goto done_with_operation;
1925019260 case eok_cli_subscript:
1925119261 gen_expr_with_parens(operand_1);
0 commit comments