Skip to content

Commit 5e5112d

Browse files
committed
Recursively drop a type's parts if the type uses any typarams, since those typarams may represent types that actually require dropping.
1 parent cf62b54 commit 5e5112d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/boot/me/trans.ml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2883,11 +2883,13 @@ let trans_visitor
28832883
patch null_jmp;
28842884
note_drop_step ty "drop_ty: done box-drop path";
28852885

2886-
| MEM_interior when type_points_to_heap ty ->
2887-
note_drop_step ty "drop_ty heap-referencing path";
2886+
| MEM_interior
2887+
when type_points_to_heap ty || (n_used_type_params ty > 0) ->
2888+
note_drop_step ty "drop_ty possibly-heap-referencing path";
28882889
iter_ty_parts ty_params cell ty
28892890
(drop_ty ty_params) curr_iso;
2890-
note_drop_step ty "drop_ty: done heap-referencing path";
2891+
note_drop_step ty
2892+
"drop_ty: done possibly-heap-referencing path";
28912893

28922894

28932895
| MEM_interior ->

0 commit comments

Comments
 (0)