Skip to content

Commit

Permalink
Explicitly invoke goto_program.update() where remove_skip is not used
Browse files Browse the repository at this point in the history
  • Loading branch information
tautschnig committed Jun 4, 2018
1 parent 6bac80e commit 3f34c1a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/goto-programs/remove_unreachable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,20 @@ void remove_unreachable(goto_programt &goto_program)

// make all unreachable code a skip
// unless it's an 'end_function'
bool did_something = false;

Forall_goto_program_instructions(it, goto_program)
{
if(reachable.find(it)==reachable.end() &&
!it->is_end_function())
{
it->make_skip();
did_something = true;
}
}

if(did_something)
goto_program.update();
}

/// Removes unreachable instructions from all functions.
Expand Down

0 comments on commit 3f34c1a

Please sign in to comment.