Catch panics on the FFI boundary between the runtime and the host for wasmtime (#11189)

* Catch panics on the FFI boundary between the runtime and the host for `wasmtime`

* Use an already existing test runtime function

* Merge the tests together
This commit is contained in:
Koute
2022-04-08 20:26:47 +09:00
committed by GitHub
parent 2a5c11e2cc
commit 1411e028aa
3 changed files with 39 additions and 10 deletions
@@ -113,7 +113,9 @@ sp_core::wasm_export_functions! {
}
}
fn test_exhaust_heap() -> Vec<u8> { Vec::with_capacity(16777216) }
fn test_allocate_vec(size: u32) -> Vec<u8> {
Vec::with_capacity(size as usize)
}
fn test_fp_f32add(a: [u8; 4], b: [u8; 4]) -> [u8; 4] {
let a = f32::from_le_bytes(a);