Skip to content

Don't simplify guard to skip instructions #4307

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
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
10 changes: 4 additions & 6 deletions src/goto-symex/symex_goto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,13 @@ void goto_symext::symex_goto(statet &state)
}
}

exprt simpl_state_guard = state.guard.as_expr();
do_simplify(simpl_state_guard);

// No point executing both branches of an unconditional goto.
if(
new_guard.is_true() && // We have an unconditional goto, AND
// either there are no blocks between us and the target in the
// surrounding scope
(simpl_state_guard.is_true() ||
// either there are no reachable blocks between us and the target in the
// surrounding scope (because state.guard == true implies there is no path
// around this GOTO instruction)
(state.guard.is_true() ||
// or there is another block, but we're doing path exploration so
// we're going to skip over it for now and return to it later.
symex_config.doing_path_exploration))
Expand Down