File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -316,9 +316,8 @@ void java_object_factoryt::gen_nondet_init(
316
316
{
317
317
const struct_typet &struct_type=to_struct_type (subtype);
318
318
const irep_idt struct_tag=struct_type.get_tag ();
319
- // set to null if found in recursion set and not a sub-type
320
- if (recursion_set.find (struct_tag)!=recursion_set.end () &&
321
- struct_tag==class_identifier)
319
+ // If this is a recursive type of some kind, set null.
320
+ if (!recursion_set.insert (struct_tag).second )
322
321
{
323
322
if (update_in_place==NO_UPDATE_IN_PLACE)
324
323
set_null (expr, pointer_type);
@@ -403,9 +402,6 @@ void java_object_factoryt::gen_nondet_init(
403
402
if (!is_sub)
404
403
class_identifier=struct_tag;
405
404
406
- recursion_set.insert (struct_tag);
407
- assert (!recursion_set.empty ());
408
-
409
405
for (const auto &component : components)
410
406
{
411
407
const typet &component_type=component.type ();
@@ -460,7 +456,6 @@ void java_object_factoryt::gen_nondet_init(
460
456
substruct_in_place);
461
457
}
462
458
}
463
- recursion_set.erase (struct_tag);
464
459
}
465
460
else
466
461
{
You can’t perform that action at this time.
0 commit comments