@@ -23,6 +23,7 @@ Author: Michael Tautschnig, Daniel Kroening
23
23
24
24
static void rename_symbols_in_function (
25
25
goto_functionst::goto_functiont &function,
26
+ irep_idt &new_function_name,
26
27
const rename_symbolt &rename_symbol)
27
28
{
28
29
goto_programt &program=function.body ;
@@ -32,6 +33,9 @@ static void rename_symbols_in_function(
32
33
{
33
34
rename_symbol (iit->code );
34
35
rename_symbol (iit->guard );
36
+ // we need to update the instruction's function field as
37
+ // well, with the new symbol for the function
38
+ iit->function =new_function_name;
35
39
}
36
40
}
37
41
@@ -67,7 +71,7 @@ static bool link_functions(
67
71
68
72
if (dest_f_it==dest_functions.function_map .end ()) // not there yet
69
73
{
70
- rename_symbols_in_function (src_it->second , rename_symbol);
74
+ rename_symbols_in_function (src_it->second , final_id, rename_symbol);
71
75
72
76
goto_functionst::goto_functiont &in_dest_symbol_table=
73
77
dest_functions.function_map [final_id];
@@ -86,7 +90,7 @@ static bool link_functions(
86
90
weak_symbols.find (final_id)!=weak_symbols.end ())
87
91
{
88
92
// the one with body wins!
89
- rename_symbols_in_function (src_func, rename_symbol);
93
+ rename_symbols_in_function (src_func, final_id, rename_symbol);
90
94
91
95
in_dest_symbol_table.body .swap (src_func.body );
92
96
in_dest_symbol_table.type =src_func.type ;
@@ -136,7 +140,10 @@ static bool link_functions(
136
140
137
141
if (!macro_application.expr_map .empty ())
138
142
Forall_goto_functions (dest_it, dest_functions)
139
- rename_symbols_in_function (dest_it->second , macro_application);
143
+ {
144
+ irep_idt final_id=dest_it->first ;
145
+ rename_symbols_in_function (dest_it->second , final_id, macro_application);
146
+ }
140
147
141
148
if (!object_type_updates.expr_map .empty ())
142
149
{
0 commit comments