Skip to content

Commit

Permalink
Merge pull request diffblue#1663 from smowton/smowton/fix/guarded_gotos
Browse files Browse the repository at this point in the history
Ensure guarded_gotos is cleared after converting each function
  • Loading branch information
smowton authored Dec 11, 2017
2 parents a2e2f74 + 2b835c6 commit c545369
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/goto-programs/goto_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,12 @@ void goto_convertt::finish_guarded_gotos(goto_programt &dest)
for(auto it=gg.ifiter, itend=gg.gotoiter; it!=itend; ++it)
it->make_skip();
}

// Must clear this, as future functions may be converted
// using the same instance of goto_convertt, typically via
// goto_convert_functions.

guarded_gotos.clear();
}

void goto_convertt::goto_convert(const codet &code, goto_programt &dest)
Expand All @@ -301,6 +307,9 @@ void goto_convertt::goto_convert_rec(
const codet &code,
goto_programt &dest)
{
// Check that guarded_gotos was cleared after any previous use of this
// converter instance:
PRECONDITION(guarded_gotos.empty());
convert(code, dest);

finish_gotos(dest);
Expand Down

0 comments on commit c545369

Please sign in to comment.