@@ -289,7 +289,8 @@ static bool link_functions(
289289 const symbol_tablet &src_symbol_table,
290290 goto_functionst &src_functions,
291291 const rename_symbolt &rename_symbol,
292- const std::unordered_set<irep_idt, irep_id_hash> &weak_symbols)
292+ const std::unordered_set<irep_idt, irep_id_hash> &weak_symbols,
293+ const replace_symbolt &object_type_updates)
293294{
294295 namespacet ns (dest_symbol_table);
295296 namespacet src_ns (src_symbol_table);
@@ -381,6 +382,16 @@ static bool link_functions(
381382 Forall_goto_functions (dest_it, dest_functions)
382383 rename_symbols_in_function (dest_it->second , macro_application);
383384
385+ if (!object_type_updates.expr_map .empty ())
386+ {
387+ Forall_goto_functions (dest_it, dest_functions)
388+ Forall_goto_program_instructions (iit, dest_it->second .body )
389+ {
390+ object_type_updates (iit->code );
391+ object_type_updates (iit->guard );
392+ }
393+ }
394+
384395 return false ;
385396}
386397
@@ -427,9 +438,14 @@ bool read_object_and_link(
427438 if (linking.typecheck_main ())
428439 return true ;
429440
430- if (link_functions (symbol_table, functions,
431- temp_model.symbol_table , temp_model.goto_functions ,
432- linking.rename_symbol , weak_symbols))
441+ if (link_functions (
442+ symbol_table,
443+ functions,
444+ temp_model.symbol_table ,
445+ temp_model.goto_functions ,
446+ linking.rename_symbol ,
447+ weak_symbols,
448+ linking.object_type_updates ))
433449 return true ;
434450
435451 return false ;
0 commit comments