mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-11 16:51:53 +03:00
Fix list length calculation
This commit is contained in:
parent
6160a2b2f1
commit
3e61b6d165
@ -2221,11 +2221,20 @@ fn list_append<'a, 'ctx, 'env>(
|
||||
"add_list_lengths",
|
||||
);
|
||||
|
||||
let elem_bytes = env
|
||||
.ptr_int()
|
||||
.const_int(elem_layout.stack_size(env.ptr_bytes) as u64, false);
|
||||
let combined_bytes = builder.build_int_mul(
|
||||
combined_list_len,
|
||||
elem_bytes,
|
||||
"add_list_lengths",
|
||||
);
|
||||
|
||||
let combined_list_ptr = env
|
||||
.builder
|
||||
.build_array_malloc(
|
||||
elem_type,
|
||||
combined_list_len,
|
||||
combined_bytes,
|
||||
"create_combined_list_ptr",
|
||||
)
|
||||
.unwrap();
|
||||
|
Loading…
Reference in New Issue
Block a user