fix that inc on list was no longer recursive

This commit is contained in:
Folkert 2023-05-03 01:03:09 +02:00
parent dc77c702c5
commit 05a9b4d601
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
3 changed files with 47 additions and 18 deletions

View file

@ -860,23 +860,23 @@ fn refcount_list<'a>(
arena.alloc(ret_stmt),
);
let modify_elems_and_list =
if layout_interner.get(elem_layout).is_refcounted() && ctx.op.is_dec() {
refcount_list_elems(
root,
ident_ids,
ctx,
layout_interner,
elem_layout,
LAYOUT_UNIT,
box_layout,
len,
elements,
modify_list,
)
} else {
modify_list
};
let relevant_op = ctx.op.is_dec() || ctx.op.is_inc();
let modify_elems_and_list = if relevant_op && layout_interner.get(elem_layout).is_refcounted() {
refcount_list_elems(
root,
ident_ids,
ctx,
layout_interner,
elem_layout,
LAYOUT_UNIT,
box_layout,
len,
elements,
modify_list,
)
} else {
modify_list
};
//
// Do nothing if the list is empty