This commit is contained in:
Folkert 2021-10-14 20:12:43 +02:00
parent 19eadbfe70
commit 7773cf9b4d

View file

@ -736,9 +736,8 @@ fn modify_refcount_list_help<'a, 'ctx, 'env>(
builder.position_at_end(modification_block);
let ptr_type = basic_type_from_layout(env, element_layout).ptr_type(AddressSpace::Generic);
if element_layout.contains_refcounted() {
let ptr_type = basic_type_from_layout(env, element_layout).ptr_type(AddressSpace::Generic);
let (len, ptr) = load_list(env.builder, original_wrapper, ptr_type);
let refcount_ptr = PointerToRefcount::from_ptr_to_data(env, ptr);
@ -790,8 +789,6 @@ fn modify_refcount_list_help<'a, 'ctx, 'env>(
}
} else {
// just increment/decrement the list itself, don't touch the elements
let ptr_type = basic_type_from_layout(env, element_layout).ptr_type(AddressSpace::Generic);
let (_, ptr) = load_list(env.builder, original_wrapper, ptr_type);
let refcount_ptr = PointerToRefcount::from_ptr_to_data(env, ptr);