Update wasm-tools crates (#5757)
* Update wasm-tools crates Pulls in a new component binary format which should hopefully be the last update for awhile. * Update cargo vet configuration
This commit is contained in:
@@ -466,86 +466,6 @@
|
||||
))
|
||||
)
|
||||
|
||||
;; struct field reordering
|
||||
(component
|
||||
(component $c1
|
||||
(type $in (record
|
||||
(field "a" u32)
|
||||
(field "b" bool)
|
||||
(field "c" u8)
|
||||
))
|
||||
(type $out (record
|
||||
(field "x" u8)
|
||||
(field "y" u32)
|
||||
(field "z" bool)
|
||||
))
|
||||
|
||||
(core module $m
|
||||
(memory (export "memory") 1)
|
||||
(func (export "r") (param i32 i32 i32) (result i32)
|
||||
(if (i32.ne (local.get 0) (i32.const 3)) (unreachable)) ;; a == 3
|
||||
(if (i32.ne (local.get 1) (i32.const 1)) (unreachable)) ;; b == true
|
||||
(if (i32.ne (local.get 2) (i32.const 2)) (unreachable)) ;; c == 2
|
||||
|
||||
|
||||
(i32.store8 offset=0 (i32.const 200) (i32.const 0xab)) ;; x == 0xab
|
||||
(i32.store offset=4 (i32.const 200) (i32.const 200)) ;; y == 200
|
||||
(i32.store8 offset=8 (i32.const 200) (i32.const 0)) ;; z == false
|
||||
i32.const 200
|
||||
)
|
||||
)
|
||||
(core instance $m (instantiate $m))
|
||||
(func (export "r") (param "a" $in) (result $out)
|
||||
(canon lift (core func $m "r") (memory $m "memory"))
|
||||
)
|
||||
)
|
||||
(component $c2
|
||||
;; note the different field orderings than the records specified above
|
||||
(type $in (record
|
||||
(field "b" bool)
|
||||
(field "c" u8)
|
||||
(field "a" u32)
|
||||
))
|
||||
(type $out (record
|
||||
(field "z" bool)
|
||||
(field "x" u8)
|
||||
(field "y" u32)
|
||||
))
|
||||
(import "r" (func $r (param "a" $in) (result $out)))
|
||||
(core module $libc (memory (export "memory") 1))
|
||||
(core instance $libc (instantiate $libc))
|
||||
(core func $r (canon lower (func $r) (memory $libc "memory")))
|
||||
|
||||
(core module $m
|
||||
(import "" "r" (func $r (param i32 i32 i32 i32)))
|
||||
(import "libc" "memory" (memory 0))
|
||||
(func $start
|
||||
i32.const 100 ;; b: bool
|
||||
i32.const 2 ;; c: u8
|
||||
i32.const 3 ;; a: u32
|
||||
i32.const 100 ;; retptr
|
||||
call $r
|
||||
|
||||
;; z == false
|
||||
(if (i32.ne (i32.load8_u offset=0 (i32.const 100)) (i32.const 0)) (unreachable))
|
||||
;; x == 0xab
|
||||
(if (i32.ne (i32.load8_u offset=1 (i32.const 100)) (i32.const 0xab)) (unreachable))
|
||||
;; y == 200
|
||||
(if (i32.ne (i32.load offset=4 (i32.const 100)) (i32.const 200)) (unreachable))
|
||||
)
|
||||
(start $start)
|
||||
)
|
||||
(core instance (instantiate $m
|
||||
(with "libc" (instance $libc))
|
||||
(with "" (instance
|
||||
(export "r" (func $r))
|
||||
))
|
||||
))
|
||||
)
|
||||
(instance $c1 (instantiate $c1))
|
||||
(instance $c2 (instantiate $c2 (with "r" (func $c1 "r"))))
|
||||
)
|
||||
|
||||
;; callee retptr misaligned
|
||||
(assert_trap
|
||||
(component
|
||||
|
||||
Reference in New Issue
Block a user