Skip to content

Commit

Permalink
[test] Disable tests that become valid with memory64 (#1648)
Browse files Browse the repository at this point in the history
  • Loading branch information
backes authored May 10, 2023
1 parent dec2738 commit b72a1aa
Showing 1 changed file with 122 additions and 115 deletions.
237 changes: 122 additions & 115 deletions test/core/binary.wast
Original file line number Diff line number Diff line change
Expand Up @@ -492,25 +492,27 @@
)
"integer representation too long"
)
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
"\01\04\01\60\00\00" ;; Type section
"\03\02\01\00" ;; Function section
"\05\03\01\00\01" ;; Memory section
"\0a\11\01" ;; Code section
;; function 0
"\0f\01\01" ;; local type count
"\7f" ;; i32
"\41\00" ;; i32.const 0
"\28" ;; i32.load
"\02" ;; alignment 2
"\82\80\80\80\80\00" ;; offset 2 with one byte too many
"\1a" ;; drop
"\0b" ;; end
)
"integer representation too long"
)
;; The memory offset will be decoded as u64 in the memory64 proposal.
;; TODO: Re-enable this test as assert_trap test in the memory64 repo.
;; (assert_malformed
;; (module binary
;; "\00asm" "\01\00\00\00"
;; "\01\04\01\60\00\00" ;; Type section
;; "\03\02\01\00" ;; Function section
;; "\05\03\01\00\01" ;; Memory section
;; "\0a\11\01" ;; Code section
;; ;; function 0
;; "\0f\01\01" ;; local type count
;; "\7f" ;; i32
;; "\41\00" ;; i32.const 0
;; "\28" ;; i32.load
;; "\02" ;; alignment 2
;; "\82\80\80\80\80\00" ;; offset 2 with one byte too many
;; "\1a" ;; drop
;; "\0b" ;; end
;; )
;; "integer representation too long"
;; )
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
Expand Down Expand Up @@ -549,25 +551,27 @@
)
"integer representation too long"
)
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
"\01\04\01\60\00\00" ;; Type section
"\03\02\01\00" ;; Function section
"\05\03\01\00\01" ;; Memory section
"\0a\12\01" ;; Code section
;; function 0
"\10\01\01" ;; local type count
"\7f" ;; i32
"\41\00" ;; i32.const 0
"\41\03" ;; i32.const 3
"\36" ;; i32.store
"\02" ;; alignment 2
"\82\80\80\80\80\00" ;; offset 2 with one byte too many
"\0b" ;; end
)
"integer representation too long"
)
;; The memory offset will be decoded as u64 in the memory64 proposal.
;; TODO: Re-enable this test as assert_trap test in the memory64 repo.
;; (assert_malformed
;; (module binary
;; "\00asm" "\01\00\00\00"
;; "\01\04\01\60\00\00" ;; Type section
;; "\03\02\01\00" ;; Function section
;; "\05\03\01\00\01" ;; Memory section
;; "\0a\12\01" ;; Code section
;; ;; function 0
;; "\10\01\01" ;; local type count
;; "\7f" ;; i32
;; "\41\00" ;; i32.const 0
;; "\41\03" ;; i32.const 3
;; "\36" ;; i32.store
;; "\02" ;; alignment 2
;; "\82\80\80\80\80\00" ;; offset 2 with one byte too many
;; "\0b" ;; end
;; )
;; "integer representation too long"
;; )

;; Signed LEB128 must not be overlong
(assert_malformed
Expand Down Expand Up @@ -629,44 +633,46 @@
)
"integer too large"
)
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
"\01\04\01\60\00\00" ;; Type section
"\03\02\01\00" ;; Function section
"\05\03\01\00\01" ;; Memory section
"\0a\10\01" ;; Code section
;; function 0
"\0e\01\01" ;; local type count
"\7f" ;; i32
"\41\00" ;; i32.const 0
"\28" ;; i32.load
"\02" ;; alignment 2
"\82\80\80\80\10" ;; offset 2 with unused bits set
"\1a" ;; drop
"\0b" ;; end
)
"integer too large"
)
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
"\01\04\01\60\00\00" ;; Type section
"\03\02\01\00" ;; Function section
"\05\03\01\00\01" ;; Memory section
"\0a\10\01" ;; Code section
;; function 0
"\0e\01\01" ;; local type count
"\7f" ;; i32
"\41\00" ;; i32.const 0
"\28" ;; i32.load
"\02" ;; alignment 2
"\82\80\80\80\40" ;; offset 2 with some unused bits set
"\1a" ;; drop
"\0b" ;; end
)
"integer too large"
)
;; The memory offset will be decoded as u64 in the memory64 proposal.
;; TODO: Re-enable this test as assert_trap test in the memory64 repo.
;; (assert_malformed
;; (module binary
;; "\00asm" "\01\00\00\00"
;; "\01\04\01\60\00\00" ;; Type section
;; "\03\02\01\00" ;; Function section
;; "\05\03\01\00\01" ;; Memory section
;; "\0a\10\01" ;; Code section
;; ;; function 0
;; "\0e\01\01" ;; local type count
;; "\7f" ;; i32
;; "\41\00" ;; i32.const 0
;; "\28" ;; i32.load
;; "\02" ;; alignment 2
;; "\82\80\80\80\10" ;; offset 2 with unused bits set
;; "\1a" ;; drop
;; "\0b" ;; end
;; )
;; "integer too large"
;; )
;; (assert_malformed
;; (module binary
;; "\00asm" "\01\00\00\00"
;; "\01\04\01\60\00\00" ;; Type section
;; "\03\02\01\00" ;; Function section
;; "\05\03\01\00\01" ;; Memory section
;; "\0a\10\01" ;; Code section
;; ;; function 0
;; "\0e\01\01" ;; local type count
;; "\7f" ;; i32
;; "\41\00" ;; i32.const 0
;; "\28" ;; i32.load
;; "\02" ;; alignment 2
;; "\82\80\80\80\40" ;; offset 2 with some unused bits set
;; "\1a" ;; drop
;; "\0b" ;; end
;; )
;; "integer too large"
;; )
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
Expand Down Expand Up @@ -742,45 +748,46 @@
)
"integer too large"
)
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
"\01\04\01\60\00\00" ;; Type section
"\03\02\01\00" ;; Function section
"\05\03\01\00\01" ;; Memory section
"\0a\11\01" ;; Code section
;; function 0
"\0f\01\01" ;; local type count
"\7f" ;; i32
"\41\00" ;; i32.const 0
"\41\03" ;; i32.const 3
"\36" ;; i32.store
"\02" ;; alignment 2
"\82\80\80\80\10" ;; offset 2 with unused bits set
"\0b" ;; end
)
"integer too large"
)
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
"\01\04\01\60\00\00" ;; Type section
"\03\02\01\00" ;; Function section
"\05\03\01\00\01" ;; Memory section
"\0a\11\01" ;; Code section

;; function 0
"\0f\01\01" ;; local type count
"\7f" ;; i32
"\41\00" ;; i32.const 0
"\41\03" ;; i32.const 3
"\36" ;; i32.store
"\02" ;; alignment 2
"\82\80\80\80\40" ;; offset 2 with some unused bits set
"\0b" ;; end
)
"integer too large"
)
;; The memory offset will be decoded as u64 in the memory64 proposal.
;; TODO: Re-enable this test as assert_trap test in the memory64 repo.
;; (assert_malformed
;; (module binary
;; "\00asm" "\01\00\00\00"
;; "\01\04\01\60\00\00" ;; Type section
;; "\03\02\01\00" ;; Function section
;; "\05\03\01\00\01" ;; Memory section
;; "\0a\11\01" ;; Code section
;; ;; function 0
;; "\0f\01\01" ;; local type count
;; "\7f" ;; i32
;; "\41\00" ;; i32.const 0
;; "\41\03" ;; i32.const 3
;; "\36" ;; i32.store
;; "\02" ;; alignment 2
;; "\82\80\80\80\10" ;; offset 2 with unused bits set
;; "\0b" ;; end
;; )
;; "integer too large"
;; )
;; (assert_malformed
;; (module binary
;; "\00asm" "\01\00\00\00"
;; "\01\04\01\60\00\00" ;; Type section
;; "\03\02\01\00" ;; Function section
;; "\05\03\01\00\01" ;; Memory section
;; "\0a\11\01" ;; Code section
;; ;; function 0
;; "\0f\01\01" ;; local type count
;; "\7f" ;; i32
;; "\41\00" ;; i32.const 0
;; "\41\03" ;; i32.const 3
;; "\36" ;; i32.store
;; "\02" ;; alignment 2
;; "\82\80\80\80\40" ;; offset 2 with some unused bits set
;; "\0b" ;; end
;; )
;; "integer too large"
;; )

;; Signed LEB128s sign-extend
(assert_malformed
Expand Down

0 comments on commit b72a1aa

Please sign in to comment.