mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
fix layout comparison in wasm backend
This commit is contained in:
parent
334253f47f
commit
81b4b3d22c
1 changed files with 6 additions and 1 deletions
|
@ -2158,10 +2158,15 @@ impl<'a, 'r> WasmBackend<'a, 'r> {
|
|||
self.register_helper_proc(spec_sym, spec_layout, ProcSource::Helper);
|
||||
}
|
||||
|
||||
let layout_repr = self.layout_interner.runtime_representation(layout);
|
||||
let same_layout =
|
||||
|layout| self.layout_interner.runtime_representation(layout) == layout_repr;
|
||||
let proc_index = self
|
||||
.proc_lookup
|
||||
.iter()
|
||||
.position(|lookup| lookup.name == proc_symbol && lookup.layout.arguments[0] == layout)
|
||||
.position(|lookup| {
|
||||
lookup.name == proc_symbol && same_layout(lookup.layout.arguments[0])
|
||||
})
|
||||
.unwrap();
|
||||
|
||||
self.fn_index_offset + proc_index as u32
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue