Skip to content

Commit 5d85d38

Browse files
authored
Merge pull request #8178 from tautschnig/bugfixes/remove-returns-loc-nr
remove_returns: do not lose location numbers
2 parents f034dbb + a235b44 commit 5d85d38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/goto-programs/remove_returns.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ void remove_returnst::replace_returns(
130130

131131
// now turn the `return' into `assignment'
132132
auto labels = std::move(instruction.labels);
133-
instruction = goto_programt::make_assignment(
134-
assignment, instruction.source_location());
133+
instruction.clear(goto_program_instruction_typet::ASSIGN);
134+
instruction.code_nonconst() = std::move(assignment);
135135
instruction.labels = std::move(labels);
136136
}
137137
else

0 commit comments

Comments
 (0)