Skip to content

Commit e779bd4

Browse files
committed
Explicitly invoke goto_program.update() where remove_skip is not used
1 parent 2f6d467 commit e779bd4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/goto-programs/remove_unreachable.cpp

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

4242
// make all unreachable code a skip
4343
// unless it's an 'end_function'
44+
bool did_something = false;
4445

4546
Forall_goto_program_instructions(it, goto_program)
4647
{
4748
if(reachable.find(it)==reachable.end() &&
4849
!it->is_end_function())
50+
{
4951
it->make_skip();
52+
did_something = true;
53+
}
5054
}
55+
56+
if(did_something)
57+
goto_program.update();
5158
}
5259

5360
/// Removes unreachable instructions from all functions.

0 commit comments

Comments
 (0)