Merge pull request from GHSA-q879-9g95-56mx

Add an assertion that a `HostFunc`'s `store` agrees on engines
This commit is contained in:
Nick Fitzgerald
2021-09-17 10:29:35 -07:00
committed by GitHub
4 changed files with 69 additions and 9 deletions

View File

@@ -256,7 +256,7 @@ fn get_host_function() -> Result<()> {
let mut linker = Linker::new(&engine);
linker.func_wrap("mod", "f1", || {})?;
let mut store = Store::<()>::default();
let mut store = Store::new(&engine, ());
assert!(linker
.get_by_import(&mut store, &module.imports().nth(0).unwrap())
.is_some());