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

Function panic_in_table_limiter

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

Source from the content-addressed store, hash-verified

1023#[test]
1024#[should_panic(expected = "resource limiter table growing")]
1025fn panic_in_table_limiter() {
1026 let engine = Engine::default();
1027 let linker = Linker::new(&engine);
1028
1029 let module = Module::new(&engine, r#"(module (table (export "t") 0 funcref))"#).unwrap();
1030
1031 let mut store = Store::new(&engine, Panic);
1032 store.limiter(|s| s as &mut dyn ResourceLimiter);
1033 let instance = linker.instantiate(&mut store, &module).unwrap();
1034 let table = instance.get_table(&mut store, "t").unwrap();
1035
1036 // Grow the table, which should panic
1037 table.grow(&mut store, 3, Ref::Func(None)).unwrap();
1038}
1039
1040#[tokio::test]
1041#[should_panic(expected = "async resource limiter memory growing")]

Callers

nothing calls this directly

Calls 7

newFunction · 0.50
FuncEnum · 0.50
unwrapMethod · 0.45
limiterMethod · 0.45
instantiateMethod · 0.45
get_tableMethod · 0.45
growMethod · 0.45

Tested by

no test coverage detected