MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / instance_get_export

Function instance_get_export

crates/fuzzing/tests/oom/instance.rs:102–123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

100
101#[test]
102fn instance_get_export() -> Result<()> {
103 let module_bytes = {
104 let mut config = Config::new();
105 config.concurrency_support(false);
106 let engine = Engine::new(&config)?;
107 Module::new(&engine, "(module (func (export \"f\")))")?.serialize()?
108 };
109 let mut config = Config::new();
110 config.enable_compiler(false);
111 config.concurrency_support(false);
112 let engine = Engine::new(&config)?;
113 let module = unsafe { Module::deserialize(&engine, &module_bytes)? };
114 let linker = Linker::<()>::new(&engine);
115 let instance_pre = linker.instantiate_pre(&module)?;
116
117 OomTest::new().test(|| {
118 let mut store = Store::try_new(&engine, ())?;
119 let instance = instance_pre.instantiate(&mut store)?;
120 let _export = instance.get_export(&mut store, "f");
121 Ok(())
122 })
123}
124
125#[test]
126fn instance_exports() -> Result<()> {

Callers

nothing calls this directly

Calls 11

OkFunction · 0.85
enable_compilerMethod · 0.80
newFunction · 0.50
deserializeFunction · 0.50
try_newFunction · 0.50
concurrency_supportMethod · 0.45
serializeMethod · 0.45
instantiate_preMethod · 0.45
testMethod · 0.45
instantiateMethod · 0.45
get_exportMethod · 0.45

Tested by

no test coverage detected