mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
Make clone_list more robust in crane build
This commit is contained in:
parent
5d28ae5fa6
commit
f27f324c4c
1 changed files with 13 additions and 8 deletions
|
@ -1017,16 +1017,21 @@ fn clone_list<B: Backend>(
|
||||||
ptr_bytes * Builtin::LIST_WORDS,
|
ptr_bytes * Builtin::LIST_WORDS,
|
||||||
));
|
));
|
||||||
|
|
||||||
// Store the new pointer in slot 0 of the wrapper
|
// Store the new pointer in the wrapper
|
||||||
builder
|
builder.ins().stack_store(
|
||||||
.ins()
|
new_elems_ptr,
|
||||||
.stack_store(new_elems_ptr, slot, Offset32::new(0));
|
slot,
|
||||||
|
Offset32::new((Builtin::WRAPPER_PTR * ptr_bytes) as i32),
|
||||||
|
);
|
||||||
|
|
||||||
// Store the length in slot 1 of the wrapper
|
// Store the length in slot the wrapper
|
||||||
builder
|
builder.ins().stack_store(
|
||||||
.ins()
|
list_len,
|
||||||
.stack_store(list_len, slot, Offset32::new(ptr_bytes as i32));
|
slot,
|
||||||
|
Offset32::new((Builtin::WRAPPER_LEN * ptr_bytes) as i32),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Return the wrapper struct
|
||||||
builder
|
builder
|
||||||
.ins()
|
.ins()
|
||||||
.stack_addr(cfg.pointer_type(), slot, Offset32::new(0))
|
.stack_addr(cfg.pointer_type(), slot, Offset32::new(0))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue