Skip to content

Commit ec4d5cd

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 04a93bd commit ec4d5cd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/goto-instrument/nondet_static.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ void nondet_static(
5454
if(is_constant_or_has_constant_components(sym.type(), ns))
5555
continue;
5656

57-
i_it=init.insert_before(++i_it);
57+
const goto_programt::instructiont original_instruction = instruction;
5858
i_it->make_assignment();
5959
i_it->code=code_assignt(sym, side_effect_expr_nondett(sym.type()));
60-
i_it->source_location=instruction.source_location;
61-
i_it->function=instruction.function;
60+
i_it->source_location = original_instruction.source_location;
61+
i_it->function = original_instruction.function;
6262
}
6363
else if(instruction.is_function_call())
6464
{

0 commit comments

Comments
 (0)