Skip to content

Commit a708711

Browse files
authored
Merge pull request diffblue#1648 from janmroczkowski/janmroczkowski/unified_difft-iterator-check-fix
Fix to unified_difft::lcss to not error on iterator check
2 parents 7660a98 + ae368b8 commit a708711

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/goto-diff/unified_diff.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ unified_difft::differencest unified_difft::lcss(
266266
{
267267
differences.push_back(differencet::DELETED);
268268
--i;
269-
--old_rit;
269+
if(old_goto_program.instructions.begin()!=old_rit)
270+
--old_rit;
270271
}
271272
else if(instructions_equal(*old_rit, *new_rit))
272273
{
@@ -286,7 +287,8 @@ unified_difft::differencest unified_difft::lcss(
286287
{
287288
differences.push_back(differencet::NEW);
288289
--j;
289-
--new_rit;
290+
if(new_goto_program.instructions.begin()!=new_rit)
291+
--new_rit;
290292
}
291293
}
292294

0 commit comments

Comments
 (0)