From: Robert Pengelly Date: Thu, 17 Sep 2026 07:49:25 +0000 (+0100) Subject: Fix sizeof member access after parenthesized expressions X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=c41e86658a91c297bf2866479f857b15b0f0e2ce;p=scc.git Fix sizeof member access after parenthesized expressions --- diff --git a/parse.c b/parse.c index f783950..3d73089 100644 --- a/parse.c +++ b/parse.c @@ -1107,8 +1107,17 @@ static int parse_sizeof_member_expr_size (int leading_stars, int consume_inner_r get_token (); - while (tok.kind == TOK_ARROW || tok.kind == TOK_DOT || tok.kind == TOK_LBRACK) { + while (tok.kind == TOK_ARROW || tok.kind == TOK_DOT || tok.kind == TOK_LBRACK || (consume_inner_rparen && tok.kind == TOK_RPAREN)) { + if (consume_inner_rparen && tok.kind == TOK_RPAREN) { + + get_token (); + + consume_inner_rparen = 0; + continue; + + } + if (tok.kind == TOK_LBRACK) { int depth = 1; @@ -1246,10 +1255,6 @@ static int parse_sizeof_member_expr_size (int leading_stars, int consume_inner_r } - if (consume_inner_rparen && tok.kind == TOK_RPAREN) { - get_token (); - } - if (leading_stars > 0 && final_is_array) { int remaining_stars = leading_stars - 1;