Skip to content

Commit 86b6a18

Browse files
authored
Make binary-leb128 test memory64-ready (#1650)
This merges part of WebAssembly/memory64#14 to make the tests fail both before and after memory64. This allows engines to enable memory64 without failing spec tests.
1 parent 0a190c9 commit 86b6a18

File tree

1 file changed

+84
-81
lines changed

1 file changed

+84
-81
lines changed

test/core/binary-leb128.wast

Lines changed: 84 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -404,19 +404,19 @@
404404
(assert_malformed
405405
(module binary
406406
"\00asm" "\01\00\00\00"
407-
"\01\04\01\60\00\00" ;; Type section
408-
"\03\02\01\00" ;; Function section
409-
"\05\03\01\00\01" ;; Memory section
410-
"\0a\11\01" ;; Code section
407+
"\01\04\01\60\00\00" ;; Type section
408+
"\03\02\01\00" ;; Function section
409+
"\05\03\01\00\01" ;; Memory section
410+
"\0a\11\01" ;; Code section
411411
;; function 0
412-
"\0f\01\01" ;; local type count
413-
"\7f" ;; i32
414-
"\41\00" ;; i32.const 0
415-
"\28" ;; i32.load
416-
"\02" ;; alignment 2
417-
"\82\80\80\80\80\00" ;; offset 2 with one byte too many
418-
"\1a" ;; drop
419-
"\0b" ;; end
412+
"\0f\01\01" ;; local type count
413+
"\7f" ;; i32
414+
"\41\00" ;; i32.const 0
415+
"\28" ;; i32.load
416+
"\02" ;; alignment 2
417+
"\82\80\80\80\80\80\80\80\80\80\00" ;; offset 2 with one byte too many
418+
"\1a" ;; drop
419+
"\0b" ;; end
420420
)
421421
"integer representation too long"
422422
)
@@ -461,19 +461,19 @@
461461
(assert_malformed
462462
(module binary
463463
"\00asm" "\01\00\00\00"
464-
"\01\04\01\60\00\00" ;; Type section
465-
"\03\02\01\00" ;; Function section
466-
"\05\03\01\00\01" ;; Memory section
467-
"\0a\12\01" ;; Code section
464+
"\01\04\01\60\00\00" ;; Type section
465+
"\03\02\01\00" ;; Function section
466+
"\05\03\01\00\01" ;; Memory section
467+
"\0a\12\01" ;; Code section
468468
;; function 0
469-
"\10\01\01" ;; local type count
470-
"\7f" ;; i32
471-
"\41\00" ;; i32.const 0
472-
"\41\03" ;; i32.const 3
473-
"\36" ;; i32.store
474-
"\02" ;; alignment 2
475-
"\82\80\80\80\80\00" ;; offset 2 with one byte too many
476-
"\0b" ;; end
469+
"\10\01\01" ;; local type count
470+
"\7f" ;; i32
471+
"\41\00" ;; i32.const 0
472+
"\41\03" ;; i32.const 3
473+
"\36" ;; i32.store
474+
"\02" ;; alignment 2
475+
"\82\80\80\80\80\80\80\80\80\80\00" ;; offset 2 with one byte too many
476+
"\0b" ;; end
477477
)
478478
"integer representation too long"
479479
)
@@ -730,40 +730,42 @@
730730
(assert_malformed
731731
(module binary
732732
"\00asm" "\01\00\00\00"
733-
"\01\04\01\60\00\00" ;; Type section
734-
"\03\02\01\00" ;; Function section
735-
"\05\03\01\00\01" ;; Memory section
736-
"\0a\10\01" ;; Code section
733+
"\01\04\01\60\00\00" ;; Type section
734+
"\03\02\01\00" ;; Function section
735+
"\05\03\01\00\01" ;; Memory section
736+
"\0a\10\01" ;; Code section
737737
;; function 0
738-
"\0e\01\01" ;; local type count
739-
"\7f" ;; i32
740-
"\41\00" ;; i32.const 0
741-
"\28" ;; i32.load
742-
"\02" ;; alignment 2
743-
"\82\80\80\80\10" ;; offset 2 with unused bits set
744-
"\1a" ;; drop
745-
"\0b" ;; end
746-
)
747-
"integer too large"
738+
"\0e\01\01" ;; local type count
739+
"\7f" ;; i32
740+
"\41\00" ;; i32.const 0
741+
"\28" ;; i32.load
742+
"\02" ;; alignment 2
743+
"\82\80\80\80\80\80\80\80\80\10" ;; offset 2 with unused bits set
744+
"\1a" ;; drop
745+
"\0b" ;; end
746+
)
747+
;; TODO: This changes to "integer too large" with memory64.
748+
"integer representation too long"
748749
)
749750
(assert_malformed
750751
(module binary
751752
"\00asm" "\01\00\00\00"
752-
"\01\04\01\60\00\00" ;; Type section
753-
"\03\02\01\00" ;; Function section
754-
"\05\03\01\00\01" ;; Memory section
755-
"\0a\10\01" ;; Code section
753+
"\01\04\01\60\00\00" ;; Type section
754+
"\03\02\01\00" ;; Function section
755+
"\05\03\01\00\01" ;; Memory section
756+
"\0a\10\01" ;; Code section
756757
;; function 0
757-
"\0e\01\01" ;; local type count
758-
"\7f" ;; i32
759-
"\41\00" ;; i32.const 0
760-
"\28" ;; i32.load
761-
"\02" ;; alignment 2
762-
"\82\80\80\80\40" ;; offset 2 with some unused bits set
763-
"\1a" ;; drop
764-
"\0b" ;; end
765-
)
766-
"integer too large"
758+
"\0e\01\01" ;; local type count
759+
"\7f" ;; i32
760+
"\41\00" ;; i32.const 0
761+
"\28" ;; i32.load
762+
"\02" ;; alignment 2
763+
"\82\80\80\80\80\80\80\80\80\40" ;; offset 2 with some unused bits set
764+
"\1a" ;; drop
765+
"\0b" ;; end
766+
)
767+
;; TODO: This changes to "integer too large" with memory64.
768+
"integer representation too long"
767769
)
768770
(assert_malformed
769771
(module binary
@@ -843,41 +845,42 @@
843845
(assert_malformed
844846
(module binary
845847
"\00asm" "\01\00\00\00"
846-
"\01\04\01\60\00\00" ;; Type section
847-
"\03\02\01\00" ;; Function section
848-
"\05\03\01\00\01" ;; Memory section
849-
"\0a\11\01" ;; Code section
848+
"\01\04\01\60\00\00" ;; Type section
849+
"\03\02\01\00" ;; Function section
850+
"\05\03\01\00\01" ;; Memory section
851+
"\0a\11\01" ;; Code section
850852
;; function 0
851-
"\0f\01\01" ;; local type count
852-
"\7f" ;; i32
853-
"\41\00" ;; i32.const 0
854-
"\41\03" ;; i32.const 3
855-
"\36" ;; i32.store
856-
"\02" ;; alignment 2
857-
"\82\80\80\80\10" ;; offset 2 with unused bits set
858-
"\0b" ;; end
859-
)
860-
"integer too large"
853+
"\0f\01\01" ;; local type count
854+
"\7f" ;; i32
855+
"\41\00" ;; i32.const 0
856+
"\41\03" ;; i32.const 3
857+
"\36" ;; i32.store
858+
"\02" ;; alignment 2
859+
"\82\80\80\80\80\80\80\80\80\10" ;; offset 2 with unused bits set
860+
"\0b" ;; end
861+
)
862+
;; TODO: This changes to "integer too large" with memory64.
863+
"integer representation too long"
861864
)
862865
(assert_malformed
863866
(module binary
864867
"\00asm" "\01\00\00\00"
865-
"\01\04\01\60\00\00" ;; Type section
866-
"\03\02\01\00" ;; Function section
867-
"\05\03\01\00\01" ;; Memory section
868-
"\0a\11\01" ;; Code section
869-
868+
"\01\04\01\60\00\00" ;; Type section
869+
"\03\02\01\00" ;; Function section
870+
"\05\03\01\00\01" ;; Memory section
871+
"\0a\11\01" ;; Code section
870872
;; function 0
871-
"\0f\01\01" ;; local type count
872-
"\7f" ;; i32
873-
"\41\00" ;; i32.const 0
874-
"\41\03" ;; i32.const 3
875-
"\36" ;; i32.store
876-
"\02" ;; alignment 2
877-
"\82\80\80\80\40" ;; offset 2 with some unused bits set
878-
"\0b" ;; end
879-
)
880-
"integer too large"
873+
"\0f\01\01" ;; local type count
874+
"\7f" ;; i32
875+
"\41\00" ;; i32.const 0
876+
"\41\03" ;; i32.const 3
877+
"\36" ;; i32.store
878+
"\02" ;; alignment 2
879+
"\82\80\80\80\80\80\80\80\80\40" ;; offset 2 with some unused bits set
880+
"\0b" ;; end
881+
)
882+
;; TODO: This changes to "integer too large" with memory64.
883+
"integer representation too long"
881884
)
882885

883886
;; Signed LEB128s sign-extend

0 commit comments

Comments
 (0)