github-actions[bot] commented on Issue #1391:
Subscribe to Label Action
This issue or pull request has been labeled: "wasmtime:api"
<details> <summary>Users Subscribed to "wasmtime:api"</summary>
- @peterhuene
</details>
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
sunfishcode commented on Issue #1391:
Should it be possible to do this with this?
fn interposition() -> Result<()> { let store = Store::default(); let mut linker = Linker::new(&store); linker.allow_shadowing(true); let mut module = Module::new(&store, r#"(module (func (export "export") (result i32) (i32.const 7)))"#)?; for _ in 0..4 { let instance = linker.instantiate(&module)?; linker.define("red", "green", instance.get_export("export").unwrap().clone())?; module = Module::new(&store, r#"(module (import "red" "green" (func (result i32))) (func (export "export") (result i32) (i32.mul (call 0) (i32.const 2))) )"#)?; } let instance = linker.instantiate(&module)?; let func = instance.get_export("export").unwrap().func().unwrap(); assert_eq!(func.get0::<i32>().unwrap()().unwrap(), 112); Ok(()) }If so, can we add that as a test? If not, can you comment on what it would take to make this work?
alexcrichton commented on Issue #1391:
@sunfishcode added the test, worked like a charm on the first try!
Last updated: Nov 22 2024 at 16:03 UTC