mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
fix(wasm): ListLen does not need to match ret_layout
This commit is contained in:
parent
bc94683100
commit
787900d291
1 changed files with 9 additions and 16 deletions
|
@ -52,23 +52,16 @@ pub fn decode_low_level<'a>(
|
|||
return NotImplemented;
|
||||
}
|
||||
StrTrim => return BuiltinCall(bitcode::STR_TRIM),
|
||||
ListLen => match ret_layout {
|
||||
WasmLayout::StackMemory { .. } => return NotImplemented,
|
||||
WasmLayout::Primitive(value_type, _) => match value_type {
|
||||
I32 => {
|
||||
if let StoredValue::StackMemory { location, .. } = storage.get(&args[0]) {
|
||||
let (local_id, offset) =
|
||||
location.local_and_offset(storage.stack_frame_pointer);
|
||||
ListLen => {
|
||||
if let StoredValue::StackMemory { location, .. } = storage.get(&args[0]) {
|
||||
let (local_id, offset) = location.local_and_offset(storage.stack_frame_pointer);
|
||||
|
||||
code_builder.get_local(local_id);
|
||||
code_builder.i32_load(Align::Bytes4, offset + 4);
|
||||
} else {
|
||||
internal_error!("Unexpected storage for {:?}", args[0]);
|
||||
};
|
||||
}
|
||||
_ => return NotImplemented,
|
||||
},
|
||||
},
|
||||
code_builder.get_local(local_id);
|
||||
code_builder.i32_load(Align::Bytes4, offset + 4);
|
||||
} else {
|
||||
internal_error!("Unexpected storage for {:?}", args[0]);
|
||||
};
|
||||
}
|
||||
|
||||
ListGetUnsafe | ListSet | ListSingle | ListRepeat | ListReverse | ListConcat
|
||||
| ListContains | ListAppend | ListPrepend | ListJoin | ListRange | ListMap | ListMap2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue