mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +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);
|
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
|
let proc_index = self
|
||||||
.proc_lookup
|
.proc_lookup
|
||||||
.iter()
|
.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();
|
.unwrap();
|
||||||
|
|
||||||
self.fn_index_offset + proc_index as u32
|
self.fn_index_offset + proc_index as u32
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue