Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an assertion that a
HostFunc
's store
agrees on engines
This commit adds an assertion which was previously forgotten when inserting a `HostFunc` into a `Store`. This can happen when a `Linker` is defined with one engine but it's used to interoperate with a store defined within a different engine. A function contains type information that's only valid relative to the engine that it was defined within. This means that if a function is used within a different engine then type information may look valid when in fact it is not. For example it's otherwise possible to insert a function into an engine with one type and call it in a different engine with a different type. Similar to how `Store` misuse is a panic throughout `wasmtime`'s API this commit also turns this behavior into panic, so there's no API impact. Documentation has been updated accordingly to indicate that various functions on `Linker` will panic if a `store` is provided that's connected to a different `Engine`.
- Loading branch information
1 parent
8ebaaf9
commit bcb1dc9
Showing
4 changed files
with
69 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters