Skip to content

Commit 1da4213

Browse files
committed
Explicitly invoke goto_program.update() where remove_skip is not used
1 parent 33e2922 commit 1da4213

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/goto-programs/remove_unreachable.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,20 @@ void remove_unreachable(goto_programt &goto_program)
3939

4040
// make all unreachable code a skip
4141
// unless it's an 'end_function'
42+
bool did_something = false;
4243

4344
Forall_goto_program_instructions(it, goto_program)
4445
{
4546
if(reachable.find(it)==reachable.end() &&
4647
!it->is_end_function())
48+
{
4749
it->make_skip();
50+
did_something = true;
51+
}
4852
}
53+
54+
if(did_something)
55+
goto_program.update();
4956
}
5057

5158
/// Removes unreachable instructions from all functions.

src/goto-programs/remove_virtual_functions.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,8 @@ void remove_virtual_function(
553553

554554
rvf.remove_virtual_function(
555555
goto_program, instruction, dispatch_table, fallback_action);
556+
557+
goto_program.update();
556558
}
557559

558560
void remove_virtual_function(

0 commit comments

Comments
 (0)