Skip to content

Restore array-set for nondet arrays #820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/java_bytecode/java_object_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,10 @@ void java_object_factoryt::gen_nondet_array_init(

side_effect_exprt java_new_array(ID_java_new_array, expr.type());
java_new_array.copy_to_operands(length_sym_expr);
java_new_array.set(ID_skip_initialize, true);
// Retain the array_set instruction for the special case of a
// zero-length array, where this will be the only assignment against
// the array's identifier.
java_new_array.set(ID_skip_initialize, false);
java_new_array.type().subtype().set(ID_C_element_type, element_type);
codet assign=code_assignt(expr, java_new_array);
assign.add_source_location()=loc;
Expand Down Expand Up @@ -798,4 +801,3 @@ void gen_nondet_init(
typet(),
update_in_place);
}