fix layout comparison in wasm backend

This commit is contained in:
Folkert 2023-07-28 16:23:14 +02:00
parent 334253f47f
commit 81b4b3d22c
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -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