Skip to content

Ensure guarded_gotos is cleared after converting each function #1663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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