mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-19 03:41:22 +00:00
feat(runtime-core) vm::ImportedFunc
and vm::FuncCtx
have NonNull
pointers.
This commit is contained in:
@ -110,9 +110,13 @@ impl Instance {
|
||||
|
||||
let ctx_ptr = match start_index.local_or_import(&instance.module.info) {
|
||||
LocalOrImport::Local(_) => instance.inner.vmctx,
|
||||
LocalOrImport::Import(imported_func_index) => {
|
||||
instance.inner.import_backing.vm_functions[imported_func_index].vmctx as _
|
||||
LocalOrImport::Import(imported_func_index) => unsafe {
|
||||
instance.inner.import_backing.vm_functions[imported_func_index]
|
||||
.func_ctx
|
||||
.as_ref()
|
||||
}
|
||||
.vmctx
|
||||
.as_ptr(),
|
||||
};
|
||||
|
||||
let sig_index = *instance
|
||||
@ -195,9 +199,13 @@ impl Instance {
|
||||
|
||||
let ctx = match func_index.local_or_import(&self.module.info) {
|
||||
LocalOrImport::Local(_) => self.inner.vmctx,
|
||||
LocalOrImport::Import(imported_func_index) => {
|
||||
self.inner.import_backing.vm_functions[imported_func_index].vmctx as _
|
||||
LocalOrImport::Import(imported_func_index) => unsafe {
|
||||
self.inner.import_backing.vm_functions[imported_func_index]
|
||||
.func_ctx
|
||||
.as_ref()
|
||||
}
|
||||
.vmctx
|
||||
.as_ptr(),
|
||||
};
|
||||
|
||||
let func_wasm_inner = self
|
||||
@ -449,7 +457,7 @@ impl InstanceInner {
|
||||
let imported_func = &self.import_backing.vm_functions[imported_func_index];
|
||||
(
|
||||
imported_func.func as *const _,
|
||||
Context::External(imported_func.vmctx as _),
|
||||
Context::External(unsafe { imported_func.func_ctx.as_ref() }.vmctx.as_ptr()),
|
||||
)
|
||||
}
|
||||
};
|
||||
@ -574,9 +582,13 @@ fn call_func_with_index(
|
||||
|
||||
let ctx_ptr = match func_index.local_or_import(info) {
|
||||
LocalOrImport::Local(_) => local_ctx,
|
||||
LocalOrImport::Import(imported_func_index) => {
|
||||
import_backing.vm_functions[imported_func_index].vmctx as _
|
||||
LocalOrImport::Import(imported_func_index) => unsafe {
|
||||
import_backing.vm_functions[imported_func_index]
|
||||
.func_ctx
|
||||
.as_ref()
|
||||
}
|
||||
.vmctx
|
||||
.as_ptr(),
|
||||
};
|
||||
|
||||
let wasm = runnable
|
||||
|
Reference in New Issue
Block a user