Skip to content

Commit 7348c74

Browse files
Elements of String array argument to Java main cannot be null
1 parent 751c040 commit 7348c74

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jbmc/src/java_bytecode/java_entry_point.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,12 @@ exprt::operandst java_build_arguments(
303303
bool is_this=(param_number==0) && parameters[param_number].get_this();
304304

305305
object_factory_parameterst parameters = object_factory_parameters;
306-
if(assume_init_pointers_not_null || is_main || is_this)
306+
// only pointer must be non-null
307+
if(assume_init_pointers_not_null || is_this)
307308
parameters.max_nonnull_tree_depth = 1;
309+
// in main() also the array elements of the argument must be non-null
310+
if(is_main)
311+
parameters.max_nonnull_tree_depth = 2;
308312

309313
parameters.function_id = goto_functionst::entry_point();
310314

0 commit comments

Comments
 (0)