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

Function array_get_out_of_bounds

tests/all/arrays.rs:255–274  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

253
254#[test]
255fn array_get_out_of_bounds() -> Result<()> {
256 let mut store = gc_store()?;
257
258 let array_ty = ArrayType::new(
259 store.engine(),
260 FieldType::new(Mutability::Const, ValType::I32.into()),
261 );
262 let pre = ArrayRefPre::new(&mut store, array_ty);
263
264 let array = ArrayRef::new_fixed(
265 &mut store,
266 &pre,
267 &[Val::I32(11), Val::I32(22), Val::I32(33)],
268 )?;
269
270 assert!(array.get(&mut store, 3).is_err());
271 assert!(array.get(&mut store, 4).is_err());
272
273 Ok(())
274}
275
276#[test]
277fn array_get_on_unrooted() -> Result<()> {

Callers

nothing calls this directly

Calls 4

gc_storeFunction · 0.85
OkFunction · 0.85
newFunction · 0.50
engineMethod · 0.45

Tested by

no test coverage detected