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

Function instance_get_table

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

Source from the content-addressed store, hash-verified

210
211#[test]
212fn instance_get_table() -> Result<()> {
213 let module_bytes = {
214 let mut config = Config::new();
215 config.concurrency_support(false);
216 let engine = Engine::new(&config)?;
217 Module::new(&engine, "(module (table (export \"t\") 1 funcref))")?.serialize()?
218 };
219 let mut config = Config::new();
220 config.enable_compiler(false);
221 config.concurrency_support(false);
222 let engine = Engine::new(&config)?;
223 let module = unsafe { Module::deserialize(&engine, &module_bytes)? };
224 let linker = Linker::<()>::new(&engine);
225 let instance_pre = linker.instantiate_pre(&module)?;
226
227 OomTest::new().test(|| {
228 let mut store = Store::try_new(&engine, ())?;
229 let instance = instance_pre.instantiate(&mut store)?;
230 let t = instance.get_table(&mut store, "t");
231 assert!(t.is_some());
232 Ok(())
233 })
234}
235
236#[test]
237fn instance_get_memory() -> 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_tableMethod · 0.45

Tested by

no test coverage detected