mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-13 00:51:20 +00:00
Fix call_indirect.
This commit is contained in:
@ -194,7 +194,7 @@ impl LocalBacking {
|
||||
}
|
||||
};
|
||||
|
||||
elements[init_base + i] = vm::Anyfunc { func, ctx, sig_id };
|
||||
elements[init_base + i] = vm::Anyfunc { func, ctx, sig_id, func_index: Some(func_index) };
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -232,7 +232,12 @@ impl LocalBacking {
|
||||
}
|
||||
};
|
||||
|
||||
elements[init_base + i] = vm::Anyfunc { func, ctx, sig_id };
|
||||
elements[init_base + i] = vm::Anyfunc {
|
||||
func,
|
||||
ctx,
|
||||
sig_id,
|
||||
func_index: Some(func_index),
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -428,7 +428,7 @@ pub struct DynFunc<'a> {
|
||||
pub(crate) signature: Arc<FuncSig>,
|
||||
module: &'a ModuleInner,
|
||||
pub(crate) instance_inner: &'a InstanceInner,
|
||||
func_index: FuncIndex,
|
||||
pub func_index: FuncIndex,
|
||||
}
|
||||
|
||||
impl<'a> DynFunc<'a> {
|
||||
|
@ -110,6 +110,7 @@ impl AnyfuncTable {
|
||||
func: ptr,
|
||||
ctx: ptr::null_mut(),
|
||||
sig_id,
|
||||
func_index: None,
|
||||
}
|
||||
}
|
||||
AnyfuncInner::Managed(ref func) => {
|
||||
@ -120,6 +121,7 @@ impl AnyfuncTable {
|
||||
func: func.raw(),
|
||||
ctx: func.instance_inner.vmctx,
|
||||
sig_id,
|
||||
func_index: Some(func.func_index),
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -3,7 +3,7 @@ use crate::{
|
||||
memory::Memory,
|
||||
module::ModuleInner,
|
||||
structures::TypedIndex,
|
||||
types::{LocalOrImport, MemoryIndex},
|
||||
types::{FuncIndex, LocalOrImport, MemoryIndex},
|
||||
};
|
||||
use std::{ffi::c_void, mem, ptr};
|
||||
|
||||
@ -283,6 +283,7 @@ pub struct Anyfunc {
|
||||
pub func: *const Func,
|
||||
pub ctx: *mut Ctx,
|
||||
pub sig_id: SigId,
|
||||
pub func_index: Option<FuncIndex>,
|
||||
}
|
||||
|
||||
impl Anyfunc {
|
||||
@ -291,6 +292,7 @@ impl Anyfunc {
|
||||
func: ptr::null(),
|
||||
ctx: ptr::null_mut(),
|
||||
sig_id: SigId(u32::max_value()),
|
||||
func_index: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user