mirror of
https://github.com/mii443/wasmer.git
synced 2025-08-24 17:29:26 +00:00
Add extra layer of indirection for funcref, update tables
This is still a WIP, cranelift is passing spectests but singlepass has 3 failures and LLVM is not implemented correctly
This commit is contained in:
@ -2202,18 +2202,23 @@ impl<'ctx, 'a> LLVMFunctionCodeGenerator<'ctx, 'a> {
|
||||
// We assume the table has the `anyfunc` element type.
|
||||
let casted_table_base = self.builder.build_pointer_cast(
|
||||
table_base,
|
||||
self.intrinsics.anyfunc_ty.ptr_type(AddressSpace::Generic),
|
||||
self.intrinsics.funcref_ty.ptr_type(AddressSpace::Generic),
|
||||
"casted_table_base",
|
||||
);
|
||||
|
||||
let anyfunc_struct_ptr = unsafe {
|
||||
let funcref_ptr = unsafe {
|
||||
self.builder.build_in_bounds_gep(
|
||||
casted_table_base,
|
||||
&[func_index],
|
||||
"anyfunc_struct_ptr",
|
||||
"funcref_ptr",
|
||||
)
|
||||
};
|
||||
|
||||
let anyfunc_struct_ptr = self
|
||||
.builder
|
||||
.build_load(funcref_ptr, "anyfunc_struct_ptr")
|
||||
.into_pointer_value();
|
||||
|
||||
// Load things from the anyfunc data structure.
|
||||
let (func_ptr, found_dynamic_sigindex, ctx_ptr) = (
|
||||
self.builder
|
||||
|
Reference in New Issue
Block a user