mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-18 19:31:22 +00:00
fix(runtime-core) Introduce Context::ExternalWithEnv
.
Host functions use `Context::External` with a `*mut vm::FuncCtx` pointer, casted to `*mut vm::Ctx`. It creates a conflict with exports that also use `Context::External`. This patch introduces `Context::ExternalWithEnv` to create a specific path in the code for an external context with `*mut vm::FuncEnv`. This patch fixes all the `linking.wast` tests in the spectests.
This commit is contained in:
@ -413,6 +413,7 @@ impl InstanceInner {
|
||||
ctx: match ctx {
|
||||
Context::Internal => Context::External(self.vmctx),
|
||||
ctx @ Context::External(_) => ctx,
|
||||
func_ctx @ Context::ExternalWithEnv(_, _) => func_ctx,
|
||||
},
|
||||
signature,
|
||||
}
|
||||
@ -463,7 +464,6 @@ impl InstanceInner {
|
||||
};
|
||||
|
||||
let signature = SigRegistry.lookup_signature_ref(&module.info.signatures[sig_index]);
|
||||
// let signature = &module.info.signatures[sig_index];
|
||||
|
||||
(unsafe { FuncPointer::new(func_ptr) }, ctx, signature)
|
||||
}
|
||||
|
Reference in New Issue
Block a user