@@ -15281,16 +15281,26 @@ it is a tpck_unknown_function constant and to NULL otherwise.
1528115281} /* is_dot_static_operation */
1528215282
1528315283
15284- static void gen_array_subscript (an_expr_node_ptr expr)
15284+ static void gen_array_subscript_list (an_expr_node_ptr expr)
1528515285/*
15286- Render the given expression surrounded by brackets.
15286+ Put out the given expression list surrounded by square brackets.
1528715287*/
1528815288{
15289+ a_boolean first = TRUE;
15290+
1528915291 write_tok_ch('[');
15290- gen_expr(expr, /*need_parens=*/expr_has_comma_operation(expr),
15291- /*obj_expr_of_mfunc_operator=*/FALSE);
15292+ while (expr != NULL) {
15293+ if (first) {
15294+ first = FALSE;
15295+ } else {
15296+ write_tok_str(", ");
15297+ } /* if */
15298+ gen_expr(expr, /*need_parens=*/expr_has_comma_operation(expr),
15299+ /*obj_expr_of_mfunc_operator=*/FALSE);
15300+ expr = expr->next;
15301+ } /* if */
1529215302 write_tok_ch(']');
15293- } /* gen_array_subscript */
15303+ } /* gen_array_subscript_list */
1529415304
1529515305
1529615306static void gen_va_arg(an_expr_node_ptr expr)
@@ -17878,7 +17888,7 @@ handled through recursion.
1787817888 break;
1787917889 case eok_subscript:
1788017890 gen_member_selector_for_builtin_offsetof(arg1);
17881- gen_array_subscript (arg2);
17891+ gen_array_subscript_list (arg2);
1788217892 break;
1788317893 case eok_cast:
1788417894 case eok_base_class_cast:
@@ -19271,7 +19281,7 @@ gen_expr that might end up generating this expr as a temporary.
1927119281 parens_may_be_needed(generated_precedence[eok_subscript],
1927219282 operand_1),
1927319283 /*obj_expr_of_mfunc_operator=*/FALSE);
19274- gen_array_subscript (operand_2);
19284+ gen_array_subscript_list (operand_2);
1927519285 goto done_with_operation;
1927619286 case eok_cli_subscript:
1927719287 gen_expr_with_parens(operand_1);
0 commit comments