Skip to content

Commit 30f73f5

Browse files
author
Daniel Kroening
authored
Merge pull request #469 from mgudemann/fix_nondet_sublass_init_non_null
Fix nondet sublass init non null
2 parents 63f9182 + 50d161c commit 30f73f5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/java_bytecode/java_object_factory.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,9 @@ void java_object_factoryt::gen_nondet_init(
189189
{
190190
const struct_typet &struct_type=to_struct_type(subtype);
191191
const irep_idt struct_tag=struct_type.get_tag();
192-
193-
if(recursion_set.find(struct_tag)!=recursion_set.end())
192+
// set to null if found in recursion set and not a sub-type
193+
if(recursion_set.find(struct_tag)!=recursion_set.end() &&
194+
struct_tag==class_identifier)
194195
{
195196
// make null
196197
null_pointer_exprt null_pointer_expr(pointer_type);

0 commit comments

Comments
 (0)