get runtime representation within a pointer instead of of pointers to correctly find refcount functions

This commit is contained in:
Brendan Hansknecht 2024-07-10 22:28:14 -07:00
parent a8bef30392
commit 0f7964cc9c
No known key found for this signature in database
GPG key ID: 0EA784685083E75B

View file

@ -2113,13 +2113,19 @@ impl<'a, 'r> WasmBackend<'a, 'r> {
layout: InLayout<'a>,
op: HelperOp,
) -> u32 {
let layout_repr = if op.is_indirect() {
LayoutRepr::Ptr(layout)
} else {
self.layout_interner.runtime_representation(layout)
let layout_repr = self.layout_interner.runtime_representation(layout);
let same_layout = |layout| {
if op.is_indirect() {
if let LayoutRepr::Ptr(inner) = self.layout_interner.runtime_representation(layout)
{
self.layout_interner.runtime_representation(inner) == layout_repr
} else {
false
}
} else {
self.layout_interner.runtime_representation(layout) == layout_repr
}
};
let same_layout =
|layout| self.layout_interner.runtime_representation(layout) == layout_repr;
let proc_index = self
.proc_lookup
.iter()