mirror of
https://github.com/encounter/wasmtime.git
synced 2026-03-30 11:42:15 -07:00
615d697a0b
* Update preview1 to trap on misaligned pointers Previously Wasmtime would return `EINVAL` to a guest but the upstream documentation indicates that misaligned pointers should trap, so this commit updates the alignment error to get converted into a trap rather than than being returned to the guest. * Change OOB errors to traps too * Update preview2's implementation of preview1 * Handle some more errors
17 lines
350 B
WebAssembly Text Format
17 lines
350 B
WebAssembly Text Format
(module
|
|
(import "wasi_snapshot_preview1" "fd_write" (func $write (param i32 i32 i32 i32) (result i32)))
|
|
|
|
(memory (export "memory") 1)
|
|
|
|
(func (export "_start")
|
|
(call $write
|
|
(i32.const 1) ;; fd=1
|
|
(i32.const 1) ;; ciovec_base=1 (misaligned)
|
|
(i32.const 1) ;; ciovec_len=1
|
|
(i32.const 0) ;; retptr=0
|
|
)
|
|
drop
|
|
|
|
)
|
|
)
|