@@ -1864,8 +1864,9 @@ void read_expr_operand(block_t *parent, basic_block_t **bb)
1864
1864
1865
1865
/* Check what follows the closing ) */
1866
1866
if (lex_accept (T_close_bracket )) {
1867
+
1867
1868
if (lex_peek (T_open_curly , NULL )) {
1868
- /* (type){...} - compound literal */
1869
+ /* (type){...} - compound literal */
1869
1870
is_compound_literal = true;
1870
1871
cast_or_literal_type = type ;
1871
1872
cast_ptr_level = ptr_level ;
@@ -1891,7 +1892,7 @@ void read_expr_operand(block_t *parent, basic_block_t **bb)
1891
1892
}
1892
1893
}
1893
1894
1894
- /* add struct/union support (loretta) */
1895
+ /* add struct/union support */
1895
1896
else if (lex_peek (T_struct , NULL ) || lex_peek (T_union , NULL )) {
1896
1897
/* Check for (struct/union T){...} or (struct/union T)expr */
1897
1898
int saved_pos = SOURCE -> size ;
@@ -2071,6 +2072,9 @@ void read_expr_operand(block_t *parent, basic_block_t **bb)
2071
2072
2072
2073
} else if (cast_or_literal_type -> base_type == TYPE_int ||
2073
2074
cast_or_literal_type -> base_type == TYPE_char ) {
2075
+ /* Consume the opening { token */
2076
+ lex_expect (T_open_curly );
2077
+
2074
2078
/* Handle empty compound literals */
2075
2079
if (lex_peek (T_close_curly , NULL )) {
2076
2080
/* Empty compound literal: (int){} */
@@ -2339,8 +2343,8 @@ bool is_logical(opcode_t op)
2339
2343
return op == OP_log_and || op == OP_log_or ;
2340
2344
}
2341
2345
2342
- /* Helper function to emit struct brace initializer(loretta) */
2343
- static void emit_struct_brace_initializer (block_t * parent ,
2346
+ /* Helper function to emit struct brace initializer */
2347
+ void emit_struct_brace_initializer (block_t * parent ,
2344
2348
basic_block_t * * bb ,
2345
2349
var_t * dest ,
2346
2350
type_t * struct_type )
0 commit comments