Skip to content

Commit 9b60a26

Browse files
Elements of String array argument to Java main cannot be null
1 parent 813ebd1 commit 9b60a26

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/java_bytecode/java_entry_point.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,12 @@ exprt::operandst java_build_arguments(
206206
bool is_this=(param_number==0) && parameters[param_number].get_this();
207207

208208
object_factory_parameterst parameters = object_factory_parameters;
209-
if(assume_init_pointers_not_null || is_main || is_this)
209+
// only pointer must be non-null
210+
if(assume_init_pointers_not_null || is_this)
210211
parameters.max_nonnull_tree_depth = 1;
212+
// in main() also the array elements of the argument must be non-null
213+
if(is_main)
214+
parameters.max_nonnull_tree_depth = 2;
211215

212216
// generate code to allocate and non-deterministicaly initialize the
213217
// argument

0 commit comments

Comments
 (0)