@@ -554,7 +554,7 @@ bool read_preproc_directive(void)
554554 while (lex_peek (T_identifier , alias )) {
555555 lex_expect (T_identifier );
556556 strcpy (macro -> param_defs [macro -> num_param_defs ++ ].var_name ,
557- alias );
557+ intern_string ( alias ) );
558558 lex_accept (T_comma );
559559 }
560560 if (lex_accept (T_elipsis ))
@@ -1192,14 +1192,18 @@ void read_inner_var_decl(var_t *vd, int anon, int is_param)
11921192 /* is it function pointer declaration? */
11931193 if (lex_accept (T_open_bracket )) {
11941194 func_t func ;
1195+ char temp_name [MAX_VAR_LEN ];
11951196 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 ));
11971199 lex_expect (T_close_bracket );
11981200 read_parameter_list_decl (& func , 1 );
11991201 vd -> is_func = true;
12001202 } else {
12011203 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 ));
12031207 if (!lex_peek (T_open_bracket , NULL ) && !is_param ) {
12041208 if (vd -> is_global ) {
12051209 opstack_push (vd );
@@ -2078,7 +2082,7 @@ void read_expr_operand(block_t *parent, basic_block_t **bb)
20782082 /* indirective function pointer assignment */
20792083 vd = require_var (parent );
20802084 vd -> is_func = true;
2081- strcpy (vd -> var_name , token );
2085+ strcpy (vd -> var_name , intern_string ( token ) );
20822086 opstack_push (vd );
20832087 }
20842088 } else if (lex_accept (T_open_curly )) {
@@ -4431,7 +4435,7 @@ void read_global_statement(void)
44314435 if (!type )
44324436 type = add_type ();
44334437
4434- strcpy (type -> type_name , token );
4438+ strcpy (type -> type_name , intern_string ( token ) );
44354439 type -> base_type = TYPE_struct ;
44364440
44374441 lex_expect (T_open_curly );
@@ -4469,7 +4473,7 @@ void read_global_statement(void)
44694473 if (!type )
44704474 type = add_type ();
44714475
4472- strcpy (type -> type_name , token );
4476+ strcpy (type -> type_name , intern_string ( token ) );
44734477 type -> base_type = TYPE_union ;
44744478
44754479 lex_expect (T_open_curly );
@@ -4520,7 +4524,7 @@ void read_global_statement(void)
45204524 } while (lex_accept (T_comma ));
45214525 lex_expect (T_close_curly );
45224526 lex_ident (T_identifier , token );
4523- strcpy (type -> type_name , token );
4527+ strcpy (type -> type_name , intern_string ( token ) );
45244528 lex_expect (T_semicolon );
45254529 } else if (lex_accept (T_struct )) {
45264530 int i = 0 , size = 0 , has_struct_def = 0 ;
@@ -4535,7 +4539,7 @@ void read_global_statement(void)
45354539 if (!tag ) {
45364540 tag = add_type ();
45374541 tag -> base_type = TYPE_struct ;
4538- strcpy (tag -> type_name , token );
4542+ strcpy (tag -> type_name , intern_string ( token ) );
45394543 }
45404544 }
45414545
@@ -4574,7 +4578,7 @@ void read_global_statement(void)
45744578 strcpy (token , tag -> type_name );
45754579 memcpy (tag , type , sizeof (type_t ));
45764580 tag -> base_type = TYPE_struct ;
4577- strcpy (tag -> type_name , token );
4581+ strcpy (tag -> type_name , intern_string ( token ) );
45784582 } else {
45794583 /* If it is a forward declaration, build a connection between
45804584 * structure tag and alias. In 'find_type', it will retrieve
@@ -4597,7 +4601,7 @@ void read_global_statement(void)
45974601 if (!tag ) {
45984602 tag = add_type ();
45994603 tag -> base_type = TYPE_union ;
4600- strcpy (tag -> type_name , token );
4604+ strcpy (tag -> type_name , intern_string ( token ) );
46014605 }
46024606 }
46034607
@@ -4640,7 +4644,7 @@ void read_global_statement(void)
46404644 strcpy (token , tag -> type_name );
46414645 memcpy (tag , type , sizeof (type_t ));
46424646 tag -> base_type = TYPE_union ;
4643- strcpy (tag -> type_name , token );
4647+ strcpy (tag -> type_name , intern_string ( token ) );
46444648 } else {
46454649 /* If it is a forward declaration, build a connection between
46464650 * union tag and alias. In 'find_type', it will retrieve
0 commit comments