Skip to content

Commit 53c7a82

Browse files
authored
Merge pull request #3466 from smowton/smowton/cleanup/skip-unreachable-goto
Don't clean and rename unused guard expression
2 parents 8a75ce4 + 60d8a91 commit 53c7a82

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/goto-symex/symex_goto.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,23 @@ void goto_symext::symex_goto(statet &state)
2525
const goto_programt::instructiont &instruction=*state.source.pc;
2626
statet::framet &frame=state.top();
2727

28+
if(state.guard.is_false())
29+
{
30+
// next instruction
31+
symex_transition(state);
32+
return; // nothing to do
33+
}
34+
2835
exprt old_guard=instruction.guard;
2936
clean_expr(old_guard, state, false);
3037

3138
exprt new_guard=old_guard;
3239
state.rename(new_guard, ns);
3340
do_simplify(new_guard);
3441

35-
if(new_guard.is_false() ||
36-
state.guard.is_false())
42+
if(new_guard.is_false())
3743
{
38-
if(!state.guard.is_false())
39-
target.location(state.guard.as_expr(), state.source);
44+
target.location(state.guard.as_expr(), state.source);
4045

4146
// next instruction
4247
symex_transition(state);

0 commit comments

Comments
 (0)