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

Function panic_in_async_table_limiter

tests/all/limits.rs:1091–1107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1089#[should_panic(expected = "async resource limiter table growing")]
1090#[cfg_attr(miri, ignore)]
1091async fn panic_in_async_table_limiter() {
1092 let engine = Engine::default();
1093 let linker = Linker::<Panic>::new(&engine);
1094
1095 let module = Module::new(&engine, r#"(module (table (export "t") 0 funcref))"#).unwrap();
1096
1097 let mut store = Store::new(&engine, Panic);
1098 store.limiter_async(|s| s as &mut dyn ResourceLimiterAsync);
1099 let instance = linker.instantiate_async(&mut store, &module).await.unwrap();
1100 let table = instance.get_table(&mut store, "t").unwrap();
1101
1102 // Grow the table, which should panic
1103 table
1104 .grow_async(&mut store, 3, Ref::Func(None))
1105 .await
1106 .unwrap();
1107}
1108
1109#[test]
1110#[cfg_attr(miri, ignore)]

Callers

nothing calls this directly

Calls 7

limiter_asyncMethod · 0.80
newFunction · 0.50
FuncEnum · 0.50
unwrapMethod · 0.45
instantiate_asyncMethod · 0.45
get_tableMethod · 0.45
grow_asyncMethod · 0.45

Tested by

no test coverage detected