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

Function invalid_alignment

tests/all/component_model/func.rs:2406–2502  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2404
2405#[test]
2406fn invalid_alignment() -> Result<()> {
2407 let component = format!(
2408 r#"(component
2409 (core module $m
2410 (memory (export "memory") 1)
2411 (func (export "realloc") (param i32 i32 i32 i32) (result i32)
2412 i32.const 1)
2413
2414 (func (export "take-i32") (param i32))
2415 (func (export "ret-1") (result i32) i32.const 1)
2416 (func (export "ret-unaligned-list") (result i32)
2417 (i32.store offset=0 (i32.const 8) (i32.const 1))
2418 (i32.store offset=4 (i32.const 8) (i32.const 1))
2419 i32.const 8)
2420 )
2421 (core instance $i (instantiate $m))
2422
2423 (func (export "many-params")
2424 (param "s1" string) (param "s2" string) (param "s3" string) (param "s4" string)
2425 (param "s5" string) (param "s6" string) (param "s7" string) (param "s8" string)
2426 (param "s9" string) (param "s10" string) (param "s11" string) (param "s12" string)
2427 (canon lift
2428 (core func $i "take-i32")
2429 (memory $i "memory")
2430 (realloc (func $i "realloc"))
2431 )
2432 )
2433 (func (export "string-ret") (result string)
2434 (canon lift
2435 (core func $i "ret-1")
2436 (memory $i "memory")
2437 (realloc (func $i "realloc"))
2438 )
2439 )
2440 (func (export "list-u32-ret") (result (list u32))
2441 (canon lift
2442 (core func $i "ret-unaligned-list")
2443 (memory $i "memory")
2444 (realloc (func $i "realloc"))
2445 )
2446 )
2447 )"#
2448 );
2449
2450 let engine = super::engine();
2451 let component = Component::new(&engine, component)?;
2452 let mut store = Store::new(&engine, ());
2453 let instance = |store: &mut Store<()>| Linker::new(&engine).instantiate(store, &component);
2454
2455 let err = instance(&mut store)?
2456 .get_typed_func::<(
2457 &str,
2458 &str,
2459 &str,
2460 &str,
2461 &str,
2462 &str,
2463 &str,

Callers

nothing calls this directly

Calls 7

OkFunction · 0.85
engineFunction · 0.50
newFunction · 0.50
instantiateMethod · 0.45
callMethod · 0.45
unwrapMethod · 0.45
errMethod · 0.45

Tested by

no test coverage detected