Skip to content

Commit fb28ec0

Browse files
committed
dump-c: do not output dead instructions
When the instruction causing dead code is skipped, the dead instructions must not be generated either as demonstrated by diffblue#170. Fixes diffblue#170.
1 parent 5c0c660 commit fb28ec0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/goto-instrument/goto_program2code.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,8 @@ goto_programt::const_targett goto_program2codet::convert_goto_break_continue(
13981398
if(target->get_target()==next)
13991399
{
14001400
dest.copy_to_operands(code_skipt());
1401-
return target;
1401+
// skip over all dead instructions
1402+
return --next;
14021403
}
14031404

14041405
goto_programt::const_targett loop_end=loop_last_stack.back().first;

0 commit comments

Comments
 (0)