@@ -54,7 +54,7 @@ unified_difft::get_diff(const irep_idt &function) const
5454unified_difft::goto_program_difft unified_difft::get_diff (
5555 const goto_programt &old_goto_program,
5656 const goto_programt &new_goto_program,
57- const differencest &differences) const
57+ const differencest &differences)
5858{
5959 goto_programt::instructionst::const_iterator old_it =
6060 old_goto_program.instructions .begin ();
@@ -144,15 +144,15 @@ void unified_difft::output_diff(
144144 }
145145}
146146
147- void unified_difft::lcss (
147+ unified_difft::differencest unified_difft::lcss (
148148 const irep_idt &identifier,
149149 const goto_programt &old_goto_program,
150- const goto_programt &new_goto_program,
151- differencest &differences) const
150+ const goto_programt &new_goto_program)
152151{
153152 std::size_t old_count = old_goto_program.instructions .size ();
154153 std::size_t new_count = new_goto_program.instructions .size ();
155154
155+ differencest differences;
156156 differences.reserve (old_count + new_count);
157157
158158 // skip common prefix
@@ -200,7 +200,7 @@ void unified_difft::lcss(
200200 // the common tail
201201
202202 if (old_count == 0 && new_count == 0 )
203- return ;
203+ return differences ;
204204
205205 // apply longest common subsequence (LCSS)
206206 typedef std::vector<std::vector<std::size_t >> lcss_matrixt;
@@ -293,6 +293,8 @@ void unified_difft::lcss(
293293 // add common prefix (if any)
294294 for (; old_it != old_goto_program.instructions .begin (); --old_it)
295295 differences.push_back (differencet::SAME);
296+
297+ return differences;
296298}
297299
298300void unified_difft::unified_diff (
@@ -315,7 +317,7 @@ void unified_difft::unified_diff(
315317 new_goto_program.instructions .size (), differencet::NEW);
316318 }
317319 else
318- lcss (identifier, old_goto_program, new_goto_program, differences );
320+ differences= lcss (identifier, old_goto_program, new_goto_program);
319321}
320322
321323bool unified_difft::operator ()()
0 commit comments