mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-08 13:48:26 +00:00
Fix call_indirect.
This commit is contained in:
@@ -2425,7 +2425,7 @@ impl<'ctx, 'a> LLVMFunctionCodeGenerator<'ctx, 'a> {
|
||||
};
|
||||
|
||||
// Load things from the anyfunc data structure.
|
||||
let (func_ptr, ctx_ptr, found_dynamic_sigindex) = unsafe {
|
||||
let (func_ptr, found_dynamic_sigindex, ctx_ptr) = unsafe {
|
||||
(
|
||||
builder
|
||||
.build_load(
|
||||
@@ -2435,20 +2435,20 @@ impl<'ctx, 'a> LLVMFunctionCodeGenerator<'ctx, 'a> {
|
||||
"func_ptr",
|
||||
)
|
||||
.into_pointer_value(),
|
||||
builder.build_load(
|
||||
builder
|
||||
.build_struct_gep(anyfunc_struct_ptr, 1, "ctx_ptr_ptr")
|
||||
.unwrap(),
|
||||
"ctx_ptr",
|
||||
),
|
||||
builder
|
||||
.build_load(
|
||||
builder
|
||||
.build_struct_gep(anyfunc_struct_ptr, 2, "sigindex_ptr")
|
||||
.build_struct_gep(anyfunc_struct_ptr, 1, "sigindex_ptr")
|
||||
.unwrap(),
|
||||
"sigindex",
|
||||
)
|
||||
.into_int_value(),
|
||||
builder.build_load(
|
||||
builder
|
||||
.build_struct_gep(anyfunc_struct_ptr, 2, "ctx_ptr_ptr")
|
||||
.unwrap(),
|
||||
"ctx_ptr",
|
||||
),
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
@@ -258,8 +258,8 @@ impl<'ctx> Intrinsics<'ctx> {
|
||||
let anyfunc_ty = context.struct_type(
|
||||
&[
|
||||
i8_ptr_ty_basic,
|
||||
ctx_ptr_ty.as_basic_type_enum(),
|
||||
sigindex_ty.as_basic_type_enum(),
|
||||
ctx_ptr_ty.as_basic_type_enum(),
|
||||
],
|
||||
false,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user