@@ -554,7 +554,7 @@ bool read_preproc_directive(void)
554
554
while (lex_peek (T_identifier , alias )) {
555
555
lex_expect (T_identifier );
556
556
strcpy (macro -> param_defs [macro -> num_param_defs ++ ].var_name ,
557
- alias );
557
+ intern_string ( alias ) );
558
558
lex_accept (T_comma );
559
559
}
560
560
if (lex_accept (T_elipsis ))
@@ -1192,14 +1192,18 @@ void read_inner_var_decl(var_t *vd, int anon, int is_param)
1192
1192
/* is it function pointer declaration? */
1193
1193
if (lex_accept (T_open_bracket )) {
1194
1194
func_t func ;
1195
+ char temp_name [MAX_VAR_LEN ];
1195
1196
lex_expect (T_asterisk );
1196
- lex_ident (T_identifier , vd -> var_name );
1197
+ lex_ident (T_identifier , temp_name );
1198
+ strcpy (vd -> var_name , intern_string (temp_name ));
1197
1199
lex_expect (T_close_bracket );
1198
1200
read_parameter_list_decl (& func , 1 );
1199
1201
vd -> is_func = true;
1200
1202
} else {
1201
1203
if (anon == 0 ) {
1202
- lex_ident (T_identifier , vd -> var_name );
1204
+ char temp_name [MAX_VAR_LEN ];
1205
+ lex_ident (T_identifier , temp_name );
1206
+ strcpy (vd -> var_name , intern_string (temp_name ));
1203
1207
if (!lex_peek (T_open_bracket , NULL ) && !is_param ) {
1204
1208
if (vd -> is_global ) {
1205
1209
opstack_push (vd );
@@ -2078,7 +2082,7 @@ void read_expr_operand(block_t *parent, basic_block_t **bb)
2078
2082
/* indirective function pointer assignment */
2079
2083
vd = require_var (parent );
2080
2084
vd -> is_func = true;
2081
- strcpy (vd -> var_name , token );
2085
+ strcpy (vd -> var_name , intern_string ( token ) );
2082
2086
opstack_push (vd );
2083
2087
}
2084
2088
} else if (lex_accept (T_open_curly )) {
@@ -4431,7 +4435,7 @@ void read_global_statement(void)
4431
4435
if (!type )
4432
4436
type = add_type ();
4433
4437
4434
- strcpy (type -> type_name , token );
4438
+ strcpy (type -> type_name , intern_string ( token ) );
4435
4439
type -> base_type = TYPE_struct ;
4436
4440
4437
4441
lex_expect (T_open_curly );
@@ -4469,7 +4473,7 @@ void read_global_statement(void)
4469
4473
if (!type )
4470
4474
type = add_type ();
4471
4475
4472
- strcpy (type -> type_name , token );
4476
+ strcpy (type -> type_name , intern_string ( token ) );
4473
4477
type -> base_type = TYPE_union ;
4474
4478
4475
4479
lex_expect (T_open_curly );
@@ -4520,7 +4524,7 @@ void read_global_statement(void)
4520
4524
} while (lex_accept (T_comma ));
4521
4525
lex_expect (T_close_curly );
4522
4526
lex_ident (T_identifier , token );
4523
- strcpy (type -> type_name , token );
4527
+ strcpy (type -> type_name , intern_string ( token ) );
4524
4528
lex_expect (T_semicolon );
4525
4529
} else if (lex_accept (T_struct )) {
4526
4530
int i = 0 , size = 0 , has_struct_def = 0 ;
@@ -4535,7 +4539,7 @@ void read_global_statement(void)
4535
4539
if (!tag ) {
4536
4540
tag = add_type ();
4537
4541
tag -> base_type = TYPE_struct ;
4538
- strcpy (tag -> type_name , token );
4542
+ strcpy (tag -> type_name , intern_string ( token ) );
4539
4543
}
4540
4544
}
4541
4545
@@ -4574,7 +4578,7 @@ void read_global_statement(void)
4574
4578
strcpy (token , tag -> type_name );
4575
4579
memcpy (tag , type , sizeof (type_t ));
4576
4580
tag -> base_type = TYPE_struct ;
4577
- strcpy (tag -> type_name , token );
4581
+ strcpy (tag -> type_name , intern_string ( token ) );
4578
4582
} else {
4579
4583
/* If it is a forward declaration, build a connection between
4580
4584
* structure tag and alias. In 'find_type', it will retrieve
@@ -4597,7 +4601,7 @@ void read_global_statement(void)
4597
4601
if (!tag ) {
4598
4602
tag = add_type ();
4599
4603
tag -> base_type = TYPE_union ;
4600
- strcpy (tag -> type_name , token );
4604
+ strcpy (tag -> type_name , intern_string ( token ) );
4601
4605
}
4602
4606
}
4603
4607
@@ -4640,7 +4644,7 @@ void read_global_statement(void)
4640
4644
strcpy (token , tag -> type_name );
4641
4645
memcpy (tag , type , sizeof (type_t ));
4642
4646
tag -> base_type = TYPE_union ;
4643
- strcpy (tag -> type_name , token );
4647
+ strcpy (tag -> type_name , intern_string ( token ) );
4644
4648
} else {
4645
4649
/* If it is a forward declaration, build a connection between
4646
4650
* union tag and alias. In 'find_type', it will retrieve
0 commit comments