Skip to content

Commit 8a14e67

Browse files
committed
Use code_declt::set_initial_value
To avoid directly writing to the operands of a `code_declt`.
1 parent 51887aa commit 8a14e67

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/goto-instrument/dump_c.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ void dump_ct::cleanup_decl(
654654

655655
if(value)
656656
{
657-
decl.operands().resize(1);
657+
decl.set_initial_value({});
658658
}
659659

660660
goto_programt tmp;

src/goto-instrument/goto_program2code.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ goto_programt::const_targett goto_program2codet::convert_decl(
477477
{
478478
if(next->is_assign())
479479
{
480-
d.copy_to_operands(next->get_assign().rhs());
480+
d.set_initial_value({next->get_assign().rhs()});
481481
}
482482
else
483483
{

0 commit comments

Comments
 (0)