Skip to content

Commit dc94557

Browse files
committed
Rearrange loop in remove_java_nondet
1 parent 19c8d8d commit dc94557

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/goto-programs/remove_java_nondet.cpp

+9-8
Original file line numberDiff line numberDiff line change
@@ -298,17 +298,18 @@ static void remove_java_nondet(
298298
// Check each instruction.
299299
// `process_target` may modify the list in place, and returns the next
300300
// iterator to look at.
301+
// Can't use forall_goto_program_instructions because we don't want to
302+
// increment the iterator by one after every iteration.
301303
for(auto instruction_iterator=std::begin(goto_program.instructions),
302304
end=std::end(goto_program.instructions);
303-
instruction_iterator!=end;
304-
instruction_iterator=process_target(
305-
message_handler,
306-
symbol_table,
307-
max_nondet_array_length,
308-
goto_program,
309-
instruction_iterator))
305+
instruction_iterator!=end;)
310306
{
311-
// Loop body deliberately empty.
307+
instruction_iterator=process_target(
308+
message_handler,
309+
symbol_table,
310+
max_nondet_array_length,
311+
goto_program,
312+
instruction_iterator);
312313
}
313314
}
314315

0 commit comments

Comments
 (0)