@@ -1967,8 +1967,9 @@ void read_expr_operand(block_t *parent, basic_block_t **bb)
1967
1967
1968
1968
/* Check what follows the closing ) */
1969
1969
if (lex_accept (T_close_bracket )) {
1970
+
1970
1971
if (lex_peek (T_open_curly , NULL )) {
1971
- /* (type){...} - compound literal */
1972
+ /* (type){...} - compound literal */
1972
1973
is_compound_literal = true;
1973
1974
cast_or_literal_type = type ;
1974
1975
cast_ptr_level = ptr_level ;
@@ -1994,7 +1995,7 @@ void read_expr_operand(block_t *parent, basic_block_t **bb)
1994
1995
}
1995
1996
}
1996
1997
1997
- /* add struct/union support (loretta) */
1998
+ /* add struct/union support */
1998
1999
else if (lex_peek (T_struct , NULL ) || lex_peek (T_union , NULL )) {
1999
2000
/* Check for (struct/union T){...} or (struct/union T)expr */
2000
2001
int saved_pos = SOURCE -> size ;
@@ -2175,6 +2176,9 @@ void read_expr_operand(block_t *parent, basic_block_t **bb)
2175
2176
} else if (cast_or_literal_type -> base_type == TYPE_int ||
2176
2177
cast_or_literal_type -> base_type == TYPE_short ||
2177
2178
cast_or_literal_type -> base_type == TYPE_char ) {
2179
+ /* Consume the opening { token */
2180
+ lex_expect (T_open_curly );
2181
+
2178
2182
/* Handle empty compound literals */
2179
2183
if (lex_peek (T_close_curly , NULL )) {
2180
2184
/* Empty compound literal: (int){} */
@@ -2443,8 +2447,8 @@ bool is_logical(opcode_t op)
2443
2447
return op == OP_log_and || op == OP_log_or ;
2444
2448
}
2445
2449
2446
- /* Helper function to emit struct brace initializer(loretta) */
2447
- static void emit_struct_brace_initializer (block_t * parent ,
2450
+ /* Helper function to emit struct brace initializer */
2451
+ void emit_struct_brace_initializer (block_t * parent ,
2448
2452
basic_block_t * * bb ,
2449
2453
var_t * dest ,
2450
2454
type_t * struct_type )
0 commit comments