mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 07:14:46 +00:00
Fix list length calculation
This commit is contained in:
parent
6160a2b2f1
commit
3e61b6d165
1 changed files with 10 additions and 1 deletions
|
@ -2221,11 +2221,20 @@ fn list_append<'a, 'ctx, 'env>(
|
||||||
"add_list_lengths",
|
"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
|
let combined_list_ptr = env
|
||||||
.builder
|
.builder
|
||||||
.build_array_malloc(
|
.build_array_malloc(
|
||||||
elem_type,
|
elem_type,
|
||||||
combined_list_len,
|
combined_bytes,
|
||||||
"create_combined_list_ptr",
|
"create_combined_list_ptr",
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue