Skip to content

Commit 47cda1c

Browse files
Elements of String array argument to Java main cannot be null
1 parent 6b5334f commit 47cda1c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jbmc/src/java_bytecode/java_entry_point.cpp

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

187187
object_factory_parameterst parameters = object_factory_parameters;
188-
if(assume_init_pointers_not_null || is_main || is_this)
188+
// only pointer must be non-null
189+
if(assume_init_pointers_not_null || is_this)
189190
parameters.max_nonnull_tree_depth = 1;
191+
// in main() also the array elements of the argument must be non-null
192+
if(is_main)
193+
parameters.max_nonnull_tree_depth = 2;
190194

191195
object_factory_parameterst parameters = object_factory_parameters;
192196
parameters.function_id = goto_functionst::entry_point();

0 commit comments

Comments
 (0)