@@ -247,24 +247,31 @@ goto_programt::targett remove_virtual_functionst::remove_virtual_function(
247247 // Only create one call sequence per possible target:
248248 if (insertit.second )
249249 {
250- goto_programt::targett t1=new_code_calls.add_instruction ();
251250 if (fun.symbol_expr .has_value ())
252251 {
253252 // call function
254- *t1 = goto_programt::make_function_call (code, vcall_source_loc);
253+ goto_programt::targett t1 = new_code_calls.add (
254+ goto_programt::make_function_call (code, vcall_source_loc));
255+
255256 create_static_function_call (
256257 t1->get_function_call (), *fun.symbol_expr , ns);
258+
259+ insertit.first ->second = t1;
257260 }
258261 else
259262 {
263+ goto_programt::targett t1 = new_code_calls.add (
264+ goto_programt::make_assertion (false_exprt (), vcall_source_loc));
265+
260266 // No definition for this type; shouldn't be possible...
261- *t1 = goto_programt::make_assertion (false_exprt (), vcall_source_loc);
262267 t1->source_location .set_comment (
263268 " cannot find calls for " +
264269 id2string (code.function ().get (ID_identifier)) + " dispatching " +
265270 id2string (fun.class_id ));
271+
272+ insertit.first ->second = t1;
266273 }
267- insertit. first -> second =t1;
274+
268275 // goto final
269276 new_code_calls.add (
270277 goto_programt::make_goto (t_final, true_exprt (), vcall_source_loc));
0 commit comments