Skip to content

Commit bd46eee

Browse files
author
svorenova
committed
Make nondet-static replace lines in CPROVER_init
Instead of adding a new line that nondet initializes a variable after the original line that sets it, we now replace the original one
1 parent 386cde3 commit bd46eee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/goto-instrument/nondet_static.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ void nondet_static(
5252
if(is_constant_or_has_constant_components(sym.type(), ns))
5353
continue;
5454

55-
i_it=init.insert_before(++i_it);
55+
const goto_programt::instructiont original_instruction = instruction;
5656
i_it->make_assignment();
5757
i_it->code=code_assignt(sym, side_effect_expr_nondett(sym.type()));
58-
i_it->source_location=instruction.source_location;
59-
i_it->function=instruction.function;
58+
i_it->source_location = original_instruction.source_location;
59+
i_it->function = original_instruction.function;
6060
}
6161
else if(instruction.is_function_call())
6262
{

0 commit comments

Comments
 (0)