diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml index 5c6a65ed..5f92d5b7 100644 --- a/.github/workflows/commit.yaml +++ b/.github/workflows/commit.yaml @@ -33,7 +33,7 @@ jobs: steps: - name: Install latest wast2json run: | # Needed for build.spectest. wabt includes wast2json. - wabt_version=1.0.32 + wabt_version=1.0.33 wabt_url=https://github.com/WebAssembly/wabt/releases/download/${wabt_version}/wabt-${wabt_version}-ubuntu.tar.gz curl -sSL ${wabt_url} | tar --strip-components 2 -C /usr/local/bin -xzf - wabt-${wabt_version}/bin/wast2json diff --git a/Makefile b/Makefile index 49decc60..74d24450 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,6 @@ main_sources := $(wildcard $(filter-out %_test.go $(all_testdata) $(all_testing # Paths need to all start with ./, so we do that manually vs foreach which strips it. main_packages := $(sort $(foreach f,$(dir $(main_sources)),$(if $(findstring ./,$(f)),./,./$(f)))) -# By default, we don't run with -race as it's costly to run on every PR. go_test_options ?= -timeout 300s ensureCompilerFastest := -ldflags '-X github.com/tetratelabs/wazero/internal/integration_test/vs.ensureCompilerFastest=true' @@ -119,8 +118,8 @@ spectest_v1_testdata_dir := $(spectest_v1_dir)/testdata spec_version_v1 := wg-1.0 spectest_v2_dir := $(spectest_base_dir)/v2 spectest_v2_testdata_dir := $(spectest_v2_dir)/testdata -# Latest draft state as of Dec 16, 2022. -spec_version_v2 := 1782235239ddebaf2cb079b00fdaa2d2c4dedba3 +# Latest draft state as of May 23, 2023. +spec_version_v2 := 2e8912e88a3118a46b90e8ccb659e24b4e8f3c23 .PHONY: build.spectest build.spectest: @@ -162,7 +161,7 @@ build.spectest.v2: # Note: SIMD cases are placed in the "simd" subdirectory. @cd $(spectest_v2_testdata_dir) \ && curl -sSL 'https://api.github.com/repos/WebAssembly/spec/contents/test/core/simd?ref=$(spec_version_v2)' | jq -r '.[]| .download_url' | grep -E ".wast" | xargs -Iurl curl -sJL url -O @cd $(spectest_v2_testdata_dir) && for f in `find . -name '*.wast'`; do \ - wast2json --debug-names $$f; \ + wast2json --debug-names --no-check $$f; \ done .PHONY: test diff --git a/internal/integration_test/spectest/v2/testdata/binary-leb128.40.wasm b/internal/integration_test/spectest/v2/testdata/binary-leb128.40.wasm index b7671952..d098584c 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary-leb128.40.wasm and b/internal/integration_test/spectest/v2/testdata/binary-leb128.40.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary-leb128.43.wasm b/internal/integration_test/spectest/v2/testdata/binary-leb128.43.wasm index c9df8b4f..6e03d8e1 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary-leb128.43.wasm and b/internal/integration_test/spectest/v2/testdata/binary-leb128.43.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary-leb128.65.wasm b/internal/integration_test/spectest/v2/testdata/binary-leb128.65.wasm index 941d25bd..4167a71d 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary-leb128.65.wasm and b/internal/integration_test/spectest/v2/testdata/binary-leb128.65.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary-leb128.66.wasm b/internal/integration_test/spectest/v2/testdata/binary-leb128.66.wasm index 6ffaff42..8c8dde90 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary-leb128.66.wasm and b/internal/integration_test/spectest/v2/testdata/binary-leb128.66.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary-leb128.71.wasm b/internal/integration_test/spectest/v2/testdata/binary-leb128.71.wasm index 3dda6163..ef5d0758 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary-leb128.71.wasm and b/internal/integration_test/spectest/v2/testdata/binary-leb128.71.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary-leb128.72.wasm b/internal/integration_test/spectest/v2/testdata/binary-leb128.72.wasm index 7f5ac870..2e489e5b 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary-leb128.72.wasm and b/internal/integration_test/spectest/v2/testdata/binary-leb128.72.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary-leb128.83.wasm b/internal/integration_test/spectest/v2/testdata/binary-leb128.83.wasm new file mode 100644 index 00000000..ba035c42 Binary files /dev/null and b/internal/integration_test/spectest/v2/testdata/binary-leb128.83.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary-leb128.84.wasm b/internal/integration_test/spectest/v2/testdata/binary-leb128.84.wasm new file mode 100644 index 00000000..ea58eecf Binary files /dev/null and b/internal/integration_test/spectest/v2/testdata/binary-leb128.84.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary-leb128.85.wasm b/internal/integration_test/spectest/v2/testdata/binary-leb128.85.wasm new file mode 100644 index 00000000..149a84cb Binary files /dev/null and b/internal/integration_test/spectest/v2/testdata/binary-leb128.85.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary-leb128.86.wasm b/internal/integration_test/spectest/v2/testdata/binary-leb128.86.wasm new file mode 100644 index 00000000..a622a73c Binary files /dev/null and b/internal/integration_test/spectest/v2/testdata/binary-leb128.86.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary-leb128.87.wasm b/internal/integration_test/spectest/v2/testdata/binary-leb128.87.wasm new file mode 100644 index 00000000..b0338b3a Binary files /dev/null and b/internal/integration_test/spectest/v2/testdata/binary-leb128.87.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary-leb128.88.wasm b/internal/integration_test/spectest/v2/testdata/binary-leb128.88.wasm new file mode 100644 index 00000000..a559c85a Binary files /dev/null and b/internal/integration_test/spectest/v2/testdata/binary-leb128.88.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary-leb128.89.wasm b/internal/integration_test/spectest/v2/testdata/binary-leb128.89.wasm new file mode 100644 index 00000000..2e3e63c4 Binary files /dev/null and b/internal/integration_test/spectest/v2/testdata/binary-leb128.89.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary-leb128.90.wasm b/internal/integration_test/spectest/v2/testdata/binary-leb128.90.wasm new file mode 100644 index 00000000..99a50b57 Binary files /dev/null and b/internal/integration_test/spectest/v2/testdata/binary-leb128.90.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary-leb128.json b/internal/integration_test/spectest/v2/testdata/binary-leb128.json index f493a8c0..dfca63fb 100644 --- a/internal/integration_test/spectest/v2/testdata/binary-leb128.json +++ b/internal/integration_test/spectest/v2/testdata/binary-leb128.json @@ -65,21 +65,29 @@ {"type": "assert_malformed", "line": 686, "filename": "binary-leb128.62.wasm", "text": "integer too large", "module_type": "binary"}, {"type": "assert_malformed", "line": 702, "filename": "binary-leb128.63.wasm", "text": "integer too large", "module_type": "binary"}, {"type": "assert_malformed", "line": 718, "filename": "binary-leb128.64.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 731, "filename": "binary-leb128.65.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 750, "filename": "binary-leb128.66.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 769, "filename": "binary-leb128.67.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 787, "filename": "binary-leb128.68.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 806, "filename": "binary-leb128.69.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 825, "filename": "binary-leb128.70.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 844, "filename": "binary-leb128.71.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 863, "filename": "binary-leb128.72.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 885, "filename": "binary-leb128.73.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 895, "filename": "binary-leb128.74.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 905, "filename": "binary-leb128.75.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 915, "filename": "binary-leb128.76.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 926, "filename": "binary-leb128.77.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 936, "filename": "binary-leb128.78.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 946, "filename": "binary-leb128.79.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 956, "filename": "binary-leb128.80.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "module", "line": 967, "filename": "binary-leb128.81.wasm"}, - {"type": "assert_malformed", "line": 988, "filename": "binary-leb128.82.wasm", "text": "integer representation too long", "module_type": "binary"}]} + {"type": "assert_malformed", "line": 731, "filename": "binary-leb128.65.wasm", "text": "integer representation too long", "module_type": "binary"}, + {"type": "assert_malformed", "line": 751, "filename": "binary-leb128.66.wasm", "text": "integer representation too long", "module_type": "binary"}, + {"type": "assert_malformed", "line": 771, "filename": "binary-leb128.67.wasm", "text": "integer too large", "module_type": "binary"}, + {"type": "assert_malformed", "line": 789, "filename": "binary-leb128.68.wasm", "text": "integer too large", "module_type": "binary"}, + {"type": "assert_malformed", "line": 808, "filename": "binary-leb128.69.wasm", "text": "integer too large", "module_type": "binary"}, + {"type": "assert_malformed", "line": 827, "filename": "binary-leb128.70.wasm", "text": "integer too large", "module_type": "binary"}, + {"type": "assert_malformed", "line": 846, "filename": "binary-leb128.71.wasm", "text": "integer representation too long", "module_type": "binary"}, + {"type": "assert_malformed", "line": 866, "filename": "binary-leb128.72.wasm", "text": "integer representation too long", "module_type": "binary"}, + {"type": "assert_malformed", "line": 888, "filename": "binary-leb128.73.wasm", "text": "integer too large", "module_type": "binary"}, + {"type": "assert_malformed", "line": 898, "filename": "binary-leb128.74.wasm", "text": "integer too large", "module_type": "binary"}, + {"type": "assert_malformed", "line": 908, "filename": "binary-leb128.75.wasm", "text": "integer too large", "module_type": "binary"}, + {"type": "assert_malformed", "line": 918, "filename": "binary-leb128.76.wasm", "text": "integer too large", "module_type": "binary"}, + {"type": "assert_malformed", "line": 929, "filename": "binary-leb128.77.wasm", "text": "integer too large", "module_type": "binary"}, + {"type": "assert_malformed", "line": 939, "filename": "binary-leb128.78.wasm", "text": "integer too large", "module_type": "binary"}, + {"type": "assert_malformed", "line": 949, "filename": "binary-leb128.79.wasm", "text": "integer too large", "module_type": "binary"}, + {"type": "assert_malformed", "line": 959, "filename": "binary-leb128.80.wasm", "text": "integer too large", "module_type": "binary"}, + {"type": "module", "line": 969, "filename": "binary-leb128.81.wasm"}, + {"type": "assert_malformed", "line": 990, "filename": "binary-leb128.82.wasm", "text": "integer representation too long", "module_type": "binary"}, + {"type": "module", "line": 1007, "filename": "binary-leb128.83.wasm"}, + {"type": "module", "line": 1015, "filename": "binary-leb128.84.wasm"}, + {"type": "module", "line": 1024, "filename": "binary-leb128.85.wasm"}, + {"type": "module", "line": 1035, "filename": "binary-leb128.86.wasm"}, + {"type": "module", "line": 1043, "filename": "binary-leb128.87.wasm"}, + {"type": "module", "line": 1052, "filename": "binary-leb128.88.wasm"}, + {"type": "module", "line": 1061, "filename": "binary-leb128.89.wasm"}, + {"type": "assert_malformed", "line": 1073, "filename": "binary-leb128.90.wasm", "text": "integer representation too long", "module_type": "binary"}]} diff --git a/internal/integration_test/spectest/v2/testdata/binary-leb128.wast b/internal/integration_test/spectest/v2/testdata/binary-leb128.wast index 1b642261..335496f0 100644 --- a/internal/integration_test/spectest/v2/testdata/binary-leb128.wast +++ b/internal/integration_test/spectest/v2/testdata/binary-leb128.wast @@ -404,19 +404,19 @@ (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 + "\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 + "\0f\01\01" ;; local type count + "\7f" ;; i32 + "\41\00" ;; i32.const 0 + "\28" ;; i32.load + "\02" ;; alignment 2 + "\82\80\80\80\80\80\80\80\80\80\00" ;; offset 2 with one byte too many + "\1a" ;; drop + "\0b" ;; end ) "integer representation too long" ) @@ -461,19 +461,19 @@ (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 + "\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 + "\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\80\80\80\80\80\00" ;; offset 2 with one byte too many + "\0b" ;; end ) "integer representation too long" ) @@ -730,40 +730,42 @@ (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 + "\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 + "\0e\01\01" ;; local type count + "\7f" ;; i32 + "\41\00" ;; i32.const 0 + "\28" ;; i32.load + "\02" ;; alignment 2 + "\82\80\80\80\80\80\80\80\80\10" ;; offset 2 with unused bits set + "\1a" ;; drop + "\0b" ;; end ) - "integer too large" + ;; TODO: This changes to "integer too large" with memory64. + "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\10\01" ;; Code section + "\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 + "\0e\01\01" ;; local type count + "\7f" ;; i32 + "\41\00" ;; i32.const 0 + "\28" ;; i32.load + "\02" ;; alignment 2 + "\82\80\80\80\80\80\80\80\80\40" ;; offset 2 with some unused bits set + "\1a" ;; drop + "\0b" ;; end ) - "integer too large" + ;; TODO: This changes to "integer too large" with memory64. + "integer representation too long" ) (assert_malformed (module binary @@ -843,41 +845,42 @@ (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 + "\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 + "\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\80\80\80\80\80\10" ;; offset 2 with unused bits set + "\0b" ;; end ) - "integer too large" + ;; TODO: This changes to "integer too large" with memory64. + "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 - + "\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 + "\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\80\80\80\80\80\40" ;; offset 2 with some unused bits set + "\0b" ;; end ) - "integer too large" + ;; TODO: This changes to "integer too large" with memory64. + "integer representation too long" ) ;; Signed LEB128s sign-extend @@ -963,7 +966,6 @@ "integer too large" ) - (module binary "\00asm" "\01\00\00\00" "\01\04\01" ;; type section @@ -1000,3 +1002,81 @@ ) "integer representation too long" ) + +;; Data segment tags and memory index can have non-minimal length +(module binary + "\00asm" "\01\00\00\00" + "\05\03\01" ;; Memory section with 1 entry + "\00\00" ;; no max, minimum 0 + "\0b\07\01" ;; Data section with 1 entry + "\80\00" ;; Active segment, encoded with 2 bytes + "\41\00\0b\00" ;; (i32.const 0) with contents "" +) +(module binary + "\00asm" "\01\00\00\00" + "\05\03\01" ;; Memory section with 1 entry + "\00\00" ;; no max, minimum 0 + "\0b\08\01" ;; Data section with 1 entry + "\82\00" ;; Active segment, encoded with 2 bytes + "\00" ;; explicit memory index + "\41\00\0b\00" ;; (i32.const 0) with contents "" +) +(module binary + "\00asm" "\01\00\00\00" + "\05\03\01" ;; Memory section with 1 entry + "\00\00" ;; no max, minimum 0 + "\0b\09\01" ;; Data section with 1 entry + "\82\00" ;; Active segment, encoded with 2 bytes + "\80\00" ;; explicit memory index, encoded with 2 bytes + "\41\00\0b\00" ;; (i32.const 0) with contents "" +) + +;; Element segment tags and table index can have non-minimal length +(module binary + "\00asm" "\01\00\00\00" + "\04\04\01" ;; Table section with 1 entry + "\70\00\00" ;; no max, minimum 0, funcref + "\09\07\01" ;; Element section with 1 entry + "\80\00" ;; Active segment + "\41\00\0b\00" ;; (i32.const 0) with no elements +) +(module binary + "\00asm" "\01\00\00\00" + "\04\04\01" ;; Table section with 1 entry + "\70\00\00" ;; no max, minimum 0, funcref + "\09\09\01" ;; Element section with 1 entry + "\02" ;; Active segment + "\80\00" ;; explicit table index, encoded with 2 bytes + "\41\00\0b\00\00" ;; (i32.const 0) with no elements +) +(module binary + "\00asm" "\01\00\00\00" + "\04\04\01" ;; Table section with 1 entry + "\70\00\00" ;; no max, minimum 0, funcref + "\09\09\01" ;; Element section with 1 entry + "\82\00" ;; Active segment, encoded with 2 bytes + "\00" ;; explicit table index + "\41\00\0b\00\00" ;; (i32.const 0) with no elements +) +(module binary + "\00asm" "\01\00\00\00" + "\04\04\01" ;; Table section with 1 entry + "\70\00\00" ;; no max, minimum 0, funcref + "\09\0a\01" ;; Element section with 1 entry + "\82\00" ;; Active segment, encoded with 2 bytes + "\80\00" ;; explicit table index, encoded with 2 bytes + "\41\00\0b\00\00" ;; (i32.const 0) with no elements +) + +;; Type section with signed LEB128 encoded type +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01" ;; Type section id + "\05" ;; Type section length + "\01" ;; Types vector length + "\e0\7f" ;; Malformed functype, -0x20 in signed LEB128 encoding + "\00\00" + ) + "integer representation too long" +) diff --git a/internal/integration_test/spectest/v2/testdata/binary.100.wasm b/internal/integration_test/spectest/v2/testdata/binary.100.wasm index 3d14d314..37b74d25 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.100.wasm and b/internal/integration_test/spectest/v2/testdata/binary.100.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.101.wasm b/internal/integration_test/spectest/v2/testdata/binary.101.wasm index c04dfc96..3741691e 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.101.wasm and b/internal/integration_test/spectest/v2/testdata/binary.101.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.102.wasm b/internal/integration_test/spectest/v2/testdata/binary.102.wasm index 8fa2b9fa..8b8e7081 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.102.wasm and b/internal/integration_test/spectest/v2/testdata/binary.102.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.103.wasm b/internal/integration_test/spectest/v2/testdata/binary.103.wasm index 58074cc2..f7b7b516 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.103.wasm and b/internal/integration_test/spectest/v2/testdata/binary.103.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.104.wasm b/internal/integration_test/spectest/v2/testdata/binary.104.wasm index b751e779..67642efb 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.104.wasm and b/internal/integration_test/spectest/v2/testdata/binary.104.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.105.wasm b/internal/integration_test/spectest/v2/testdata/binary.105.wasm index e17873f4..014d810f 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.105.wasm and b/internal/integration_test/spectest/v2/testdata/binary.105.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.106.wasm b/internal/integration_test/spectest/v2/testdata/binary.106.wasm index 890072c6..5183f19e 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.106.wasm and b/internal/integration_test/spectest/v2/testdata/binary.106.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.107.wasm b/internal/integration_test/spectest/v2/testdata/binary.107.wasm index 53106f9c..9c3de579 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.107.wasm and b/internal/integration_test/spectest/v2/testdata/binary.107.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.108.wasm b/internal/integration_test/spectest/v2/testdata/binary.108.wasm index 05b63ebb..ba53fd59 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.108.wasm and b/internal/integration_test/spectest/v2/testdata/binary.108.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.109.wasm b/internal/integration_test/spectest/v2/testdata/binary.109.wasm index ec187191..6fd5badb 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.109.wasm and b/internal/integration_test/spectest/v2/testdata/binary.109.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.110.wasm b/internal/integration_test/spectest/v2/testdata/binary.110.wasm index 69e6cd10..0e1132c0 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.110.wasm and b/internal/integration_test/spectest/v2/testdata/binary.110.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.111.wasm b/internal/integration_test/spectest/v2/testdata/binary.111.wasm index 5911b153..309c6d82 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.111.wasm and b/internal/integration_test/spectest/v2/testdata/binary.111.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.32.wasm b/internal/integration_test/spectest/v2/testdata/binary.32.wasm index ddc3d641..95677bc6 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.32.wasm and b/internal/integration_test/spectest/v2/testdata/binary.32.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.33.wasm b/internal/integration_test/spectest/v2/testdata/binary.33.wasm index fcc6366a..485f1018 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.33.wasm and b/internal/integration_test/spectest/v2/testdata/binary.33.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.34.wasm b/internal/integration_test/spectest/v2/testdata/binary.34.wasm index b6ddc92a..25135e26 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.34.wasm and b/internal/integration_test/spectest/v2/testdata/binary.34.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.35.wasm b/internal/integration_test/spectest/v2/testdata/binary.35.wasm index bf2289dd..15c7cbe1 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.35.wasm and b/internal/integration_test/spectest/v2/testdata/binary.35.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.36.wasm b/internal/integration_test/spectest/v2/testdata/binary.36.wasm index 55595fb0..47bc728a 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.36.wasm and b/internal/integration_test/spectest/v2/testdata/binary.36.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.37.wasm b/internal/integration_test/spectest/v2/testdata/binary.37.wasm index 3950f79a..f8ecc3f9 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.37.wasm and b/internal/integration_test/spectest/v2/testdata/binary.37.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.38.wasm b/internal/integration_test/spectest/v2/testdata/binary.38.wasm index a53aabf7..13262200 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.38.wasm and b/internal/integration_test/spectest/v2/testdata/binary.38.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.39.wasm b/internal/integration_test/spectest/v2/testdata/binary.39.wasm index 14c28acc..a5cceaa5 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.39.wasm and b/internal/integration_test/spectest/v2/testdata/binary.39.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.40.wasm b/internal/integration_test/spectest/v2/testdata/binary.40.wasm index 3ca4821d..9a2ad599 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.40.wasm and b/internal/integration_test/spectest/v2/testdata/binary.40.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.41.wasm b/internal/integration_test/spectest/v2/testdata/binary.41.wasm index fac4e1ee..890072c6 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.41.wasm and b/internal/integration_test/spectest/v2/testdata/binary.41.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.42.wasm b/internal/integration_test/spectest/v2/testdata/binary.42.wasm index ee7d313c..53106f9c 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.42.wasm and b/internal/integration_test/spectest/v2/testdata/binary.42.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.43.wasm b/internal/integration_test/spectest/v2/testdata/binary.43.wasm index 93fb38a0..05b63ebb 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.43.wasm and b/internal/integration_test/spectest/v2/testdata/binary.43.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.44.wasm b/internal/integration_test/spectest/v2/testdata/binary.44.wasm index 7ac145ef..ec187191 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.44.wasm and b/internal/integration_test/spectest/v2/testdata/binary.44.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.45.wasm b/internal/integration_test/spectest/v2/testdata/binary.45.wasm index 6779e7a2..69e6cd10 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.45.wasm and b/internal/integration_test/spectest/v2/testdata/binary.45.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.46.wasm b/internal/integration_test/spectest/v2/testdata/binary.46.wasm index 708c663b..5911b153 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.46.wasm and b/internal/integration_test/spectest/v2/testdata/binary.46.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.47.wasm b/internal/integration_test/spectest/v2/testdata/binary.47.wasm index 16b29787..8c9b01bd 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.47.wasm and b/internal/integration_test/spectest/v2/testdata/binary.47.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.48.wasm b/internal/integration_test/spectest/v2/testdata/binary.48.wasm index bb833b24..33058f1c 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.48.wasm and b/internal/integration_test/spectest/v2/testdata/binary.48.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.49.wasm b/internal/integration_test/spectest/v2/testdata/binary.49.wasm index ba035c42..ee113209 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.49.wasm and b/internal/integration_test/spectest/v2/testdata/binary.49.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.50.wasm b/internal/integration_test/spectest/v2/testdata/binary.50.wasm index ea58eecf..e15591f6 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.50.wasm and b/internal/integration_test/spectest/v2/testdata/binary.50.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.51.wasm b/internal/integration_test/spectest/v2/testdata/binary.51.wasm index 149a84cb..30cb0f7e 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.51.wasm and b/internal/integration_test/spectest/v2/testdata/binary.51.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.52.wasm b/internal/integration_test/spectest/v2/testdata/binary.52.wasm index a622a73c..30cb0f7e 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.52.wasm and b/internal/integration_test/spectest/v2/testdata/binary.52.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.53.wasm b/internal/integration_test/spectest/v2/testdata/binary.53.wasm index b0338b3a..b68b0ac8 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.53.wasm and b/internal/integration_test/spectest/v2/testdata/binary.53.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.54.wasm b/internal/integration_test/spectest/v2/testdata/binary.54.wasm index a559c85a..8e793cea 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.54.wasm and b/internal/integration_test/spectest/v2/testdata/binary.54.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.55.wasm b/internal/integration_test/spectest/v2/testdata/binary.55.wasm index 2e3e63c4..daf30be1 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.55.wasm and b/internal/integration_test/spectest/v2/testdata/binary.55.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.56.wasm b/internal/integration_test/spectest/v2/testdata/binary.56.wasm index 99a50b57..7200d187 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.56.wasm and b/internal/integration_test/spectest/v2/testdata/binary.56.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.57.wasm b/internal/integration_test/spectest/v2/testdata/binary.57.wasm index e793dcbf..7e89cfa3 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.57.wasm and b/internal/integration_test/spectest/v2/testdata/binary.57.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.58.wasm b/internal/integration_test/spectest/v2/testdata/binary.58.wasm index cc6ec0cd..67daf5fa 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.58.wasm and b/internal/integration_test/spectest/v2/testdata/binary.58.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.59.wasm b/internal/integration_test/spectest/v2/testdata/binary.59.wasm index a6ec0f0c..563c1ef2 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.59.wasm and b/internal/integration_test/spectest/v2/testdata/binary.59.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.60.wasm b/internal/integration_test/spectest/v2/testdata/binary.60.wasm index 06d3f715..a72bfb1b 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.60.wasm and b/internal/integration_test/spectest/v2/testdata/binary.60.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.61.wasm b/internal/integration_test/spectest/v2/testdata/binary.61.wasm index c85d6544..0fa05ec7 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.61.wasm and b/internal/integration_test/spectest/v2/testdata/binary.61.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.62.wasm b/internal/integration_test/spectest/v2/testdata/binary.62.wasm index 2974bc6a..c18e5de5 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.62.wasm and b/internal/integration_test/spectest/v2/testdata/binary.62.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.63.wasm b/internal/integration_test/spectest/v2/testdata/binary.63.wasm index 61cc0ce6..60f5299f 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.63.wasm and b/internal/integration_test/spectest/v2/testdata/binary.63.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.64.wasm b/internal/integration_test/spectest/v2/testdata/binary.64.wasm index a964e6fd..451a27b6 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.64.wasm and b/internal/integration_test/spectest/v2/testdata/binary.64.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.65.wasm b/internal/integration_test/spectest/v2/testdata/binary.65.wasm index 48eed1dd..03d3ccfc 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.65.wasm and b/internal/integration_test/spectest/v2/testdata/binary.65.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.66.wasm b/internal/integration_test/spectest/v2/testdata/binary.66.wasm index 3d14d314..7f64e5f1 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.66.wasm and b/internal/integration_test/spectest/v2/testdata/binary.66.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.67.wasm b/internal/integration_test/spectest/v2/testdata/binary.67.wasm index c04dfc96..726e720c 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.67.wasm and b/internal/integration_test/spectest/v2/testdata/binary.67.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.68.wasm b/internal/integration_test/spectest/v2/testdata/binary.68.wasm index 8fa2b9fa..d05238e5 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.68.wasm and b/internal/integration_test/spectest/v2/testdata/binary.68.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.69.wasm b/internal/integration_test/spectest/v2/testdata/binary.69.wasm index 58074cc2..c7aa0692 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.69.wasm and b/internal/integration_test/spectest/v2/testdata/binary.69.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.70.wasm b/internal/integration_test/spectest/v2/testdata/binary.70.wasm index b751e779..bf252f59 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.70.wasm and b/internal/integration_test/spectest/v2/testdata/binary.70.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.71.wasm b/internal/integration_test/spectest/v2/testdata/binary.71.wasm index e17873f4..40a92f42 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.71.wasm and b/internal/integration_test/spectest/v2/testdata/binary.71.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.72.wasm b/internal/integration_test/spectest/v2/testdata/binary.72.wasm index 8fa2b9fa..917edfc5 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.72.wasm and b/internal/integration_test/spectest/v2/testdata/binary.72.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.73.wasm b/internal/integration_test/spectest/v2/testdata/binary.73.wasm index 58074cc2..aa1bdd37 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.73.wasm and b/internal/integration_test/spectest/v2/testdata/binary.73.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.74.wasm b/internal/integration_test/spectest/v2/testdata/binary.74.wasm index b751e779..43a017a5 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.74.wasm and b/internal/integration_test/spectest/v2/testdata/binary.74.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.75.wasm b/internal/integration_test/spectest/v2/testdata/binary.75.wasm index e17873f4..bb6fecd8 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.75.wasm and b/internal/integration_test/spectest/v2/testdata/binary.75.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.76.wasm b/internal/integration_test/spectest/v2/testdata/binary.76.wasm index f8ecc3f9..8677ca2f 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.76.wasm and b/internal/integration_test/spectest/v2/testdata/binary.76.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.77.wasm b/internal/integration_test/spectest/v2/testdata/binary.77.wasm index 13262200..d10b25b7 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.77.wasm and b/internal/integration_test/spectest/v2/testdata/binary.77.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.78.wasm b/internal/integration_test/spectest/v2/testdata/binary.78.wasm index a5cceaa5..13650510 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.78.wasm and b/internal/integration_test/spectest/v2/testdata/binary.78.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.79.wasm b/internal/integration_test/spectest/v2/testdata/binary.79.wasm index e793dcbf..30b6b32d 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.79.wasm and b/internal/integration_test/spectest/v2/testdata/binary.79.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.80.wasm b/internal/integration_test/spectest/v2/testdata/binary.80.wasm index b7671952..65c77c11 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.80.wasm and b/internal/integration_test/spectest/v2/testdata/binary.80.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.81.wasm b/internal/integration_test/spectest/v2/testdata/binary.81.wasm index 81dbfc07..a9ad72cb 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.81.wasm and b/internal/integration_test/spectest/v2/testdata/binary.81.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.82.wasm b/internal/integration_test/spectest/v2/testdata/binary.82.wasm index dfc06872..01571ab6 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.82.wasm and b/internal/integration_test/spectest/v2/testdata/binary.82.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.83.wasm b/internal/integration_test/spectest/v2/testdata/binary.83.wasm index c9df8b4f..204f689c 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.83.wasm and b/internal/integration_test/spectest/v2/testdata/binary.83.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.84.wasm b/internal/integration_test/spectest/v2/testdata/binary.84.wasm index cc6ec0cd..a2492cb9 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.84.wasm and b/internal/integration_test/spectest/v2/testdata/binary.84.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.85.wasm b/internal/integration_test/spectest/v2/testdata/binary.85.wasm index a6ec0f0c..2bb1999c 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.85.wasm and b/internal/integration_test/spectest/v2/testdata/binary.85.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.86.wasm b/internal/integration_test/spectest/v2/testdata/binary.86.wasm index 06d3f715..cc2e20d4 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.86.wasm and b/internal/integration_test/spectest/v2/testdata/binary.86.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.87.wasm b/internal/integration_test/spectest/v2/testdata/binary.87.wasm index c85d6544..cd4d6a3a 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.87.wasm and b/internal/integration_test/spectest/v2/testdata/binary.87.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.88.wasm b/internal/integration_test/spectest/v2/testdata/binary.88.wasm index 2974bc6a..a5eb4ed6 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.88.wasm and b/internal/integration_test/spectest/v2/testdata/binary.88.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.89.wasm b/internal/integration_test/spectest/v2/testdata/binary.89.wasm index 61cc0ce6..01387628 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.89.wasm and b/internal/integration_test/spectest/v2/testdata/binary.89.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.90.wasm b/internal/integration_test/spectest/v2/testdata/binary.90.wasm index 941d25bd..a0807106 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.90.wasm and b/internal/integration_test/spectest/v2/testdata/binary.90.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.91.wasm b/internal/integration_test/spectest/v2/testdata/binary.91.wasm index 6ffaff42..5b354f5a 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.91.wasm and b/internal/integration_test/spectest/v2/testdata/binary.91.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.92.wasm b/internal/integration_test/spectest/v2/testdata/binary.92.wasm index adea9564..84af5af1 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.92.wasm and b/internal/integration_test/spectest/v2/testdata/binary.92.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.93.wasm b/internal/integration_test/spectest/v2/testdata/binary.93.wasm index f7800684..78a70f52 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.93.wasm and b/internal/integration_test/spectest/v2/testdata/binary.93.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.94.wasm b/internal/integration_test/spectest/v2/testdata/binary.94.wasm index 0e796a50..11eadff0 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.94.wasm and b/internal/integration_test/spectest/v2/testdata/binary.94.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.95.wasm b/internal/integration_test/spectest/v2/testdata/binary.95.wasm index c6633a70..4d27d5b5 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.95.wasm and b/internal/integration_test/spectest/v2/testdata/binary.95.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.96.wasm b/internal/integration_test/spectest/v2/testdata/binary.96.wasm index 3dda6163..26a8d65f 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.96.wasm and b/internal/integration_test/spectest/v2/testdata/binary.96.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.97.wasm b/internal/integration_test/spectest/v2/testdata/binary.97.wasm index 7f5ac870..2ca7f577 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.97.wasm and b/internal/integration_test/spectest/v2/testdata/binary.97.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.98.wasm b/internal/integration_test/spectest/v2/testdata/binary.98.wasm index a964e6fd..2a75cdb0 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.98.wasm and b/internal/integration_test/spectest/v2/testdata/binary.98.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.99.wasm b/internal/integration_test/spectest/v2/testdata/binary.99.wasm index 48eed1dd..8a2f86bb 100644 Binary files a/internal/integration_test/spectest/v2/testdata/binary.99.wasm and b/internal/integration_test/spectest/v2/testdata/binary.99.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/binary.json b/internal/integration_test/spectest/v2/testdata/binary.json index 89eed8cc..73767d65 100644 --- a/internal/integration_test/spectest/v2/testdata/binary.json +++ b/internal/integration_test/spectest/v2/testdata/binary.json @@ -37,143 +37,78 @@ {"type": "assert_malformed", "line": 50, "filename": "binary.34.wasm", "text": "malformed section id", "module_type": "binary"}, {"type": "assert_malformed", "line": 51, "filename": "binary.35.wasm", "text": "malformed section id", "module_type": "binary"}, {"type": "assert_malformed", "line": 52, "filename": "binary.36.wasm", "text": "malformed section id", "module_type": "binary"}, - {"type": "module", "line": 55, "filename": "binary.37.wasm"}, - {"type": "module", "line": 60, "filename": "binary.38.wasm"}, - {"type": "module", "line": 67, "filename": "binary.39.wasm"}, - {"type": "module", "line": 74, "filename": "binary.40.wasm"}, - {"type": "module", "line": 81, "filename": "binary.41.wasm"}, - {"type": "module", "line": 88, "filename": "binary.42.wasm"}, - {"type": "module", "line": 96, "filename": "binary.43.wasm"}, - {"type": "module", "line": 103, "filename": "binary.44.wasm"}, - {"type": "module", "line": 110, "filename": "binary.45.wasm"}, - {"type": "module", "line": 117, "filename": "binary.46.wasm"}, - {"type": "module", "line": 125, "filename": "binary.47.wasm"}, - {"type": "module", "line": 134, "filename": "binary.48.wasm"}, - {"type": "module", "line": 144, "filename": "binary.49.wasm"}, - {"type": "module", "line": 152, "filename": "binary.50.wasm"}, - {"type": "module", "line": 161, "filename": "binary.51.wasm"}, - {"type": "module", "line": 172, "filename": "binary.52.wasm"}, - {"type": "module", "line": 180, "filename": "binary.53.wasm"}, - {"type": "module", "line": 189, "filename": "binary.54.wasm"}, - {"type": "module", "line": 198, "filename": "binary.55.wasm"}, - {"type": "assert_malformed", "line": 210, "filename": "binary.56.wasm", "text": "integer representation too long", "module_type": "binary"}, - {"type": "assert_malformed", "line": 223, "filename": "binary.57.wasm", "text": "integer representation too long", "module_type": "binary"}, - {"type": "assert_malformed", "line": 233, "filename": "binary.58.wasm", "text": "integer representation too long", "module_type": "binary"}, - {"type": "assert_malformed", "line": 243, "filename": "binary.59.wasm", "text": "integer representation too long", "module_type": "binary"}, - {"type": "assert_malformed", "line": 254, "filename": "binary.60.wasm", "text": "integer representation too long", "module_type": "binary"}, - {"type": "assert_malformed", "line": 264, "filename": "binary.61.wasm", "text": "integer representation too long", "module_type": "binary"}, - {"type": "assert_malformed", "line": 276, "filename": "binary.62.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 284, "filename": "binary.63.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 294, "filename": "binary.64.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 304, "filename": "binary.65.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 314, "filename": "binary.66.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 324, "filename": "binary.67.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 335, "filename": "binary.68.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 345, "filename": "binary.69.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 355, "filename": "binary.70.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 365, "filename": "binary.71.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 376, "filename": "binary.72.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 386, "filename": "binary.73.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 396, "filename": "binary.74.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 406, "filename": "binary.75.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 418, "filename": "binary.76.wasm", "text": "END opcode expected", "module_type": "binary"}, - {"type": "assert_malformed", "line": 439, "filename": "binary.77.wasm", "text": "unexpected end of section or function", "module_type": "binary"}, - {"type": "assert_malformed", "line": 455, "filename": "binary.78.wasm", "text": "section size mismatch", "module_type": "binary"}, - {"type": "assert_malformed", "line": 475, "filename": "binary.79.wasm", "text": "integer representation too long", "module_type": "binary"}, - {"type": "assert_malformed", "line": 483, "filename": "binary.80.wasm", "text": "integer representation too long", "module_type": "binary"}, - {"type": "assert_malformed", "line": 502, "filename": "binary.81.wasm", "text": "integer representation too long", "module_type": "binary"}, - {"type": "assert_malformed", "line": 521, "filename": "binary.82.wasm", "text": "integer representation too long", "module_type": "binary"}, - {"type": "assert_malformed", "line": 540, "filename": "binary.83.wasm", "text": "integer representation too long", "module_type": "binary"}, - {"type": "assert_malformed", "line": 561, "filename": "binary.84.wasm", "text": "integer representation too long", "module_type": "binary"}, - {"type": "assert_malformed", "line": 571, "filename": "binary.85.wasm", "text": "integer representation too long", "module_type": "binary"}, - {"type": "assert_malformed", "line": 582, "filename": "binary.86.wasm", "text": "integer representation too long", "module_type": "binary"}, - {"type": "assert_malformed", "line": 592, "filename": "binary.87.wasm", "text": "integer representation too long", "module_type": "binary"}, - {"type": "assert_malformed", "line": 604, "filename": "binary.88.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 612, "filename": "binary.89.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 620, "filename": "binary.90.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 639, "filename": "binary.91.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 658, "filename": "binary.92.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 676, "filename": "binary.93.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 695, "filename": "binary.94.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 714, "filename": "binary.95.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 733, "filename": "binary.96.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 752, "filename": "binary.97.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 774, "filename": "binary.98.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 784, "filename": "binary.99.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 794, "filename": "binary.100.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 804, "filename": "binary.101.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 815, "filename": "binary.102.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 825, "filename": "binary.103.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 835, "filename": "binary.104.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 845, "filename": "binary.105.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 857, "filename": "binary.106.wasm", "text": "zero byte expected", "module_type": "binary"}, - {"type": "assert_malformed", "line": 877, "filename": "binary.107.wasm", "text": "zero byte expected", "module_type": "binary"}, - {"type": "assert_malformed", "line": 897, "filename": "binary.108.wasm", "text": "zero byte expected", "module_type": "binary"}, - {"type": "assert_malformed", "line": 916, "filename": "binary.109.wasm", "text": "zero byte expected", "module_type": "binary"}, - {"type": "assert_malformed", "line": 935, "filename": "binary.110.wasm", "text": "zero byte expected", "module_type": "binary"}, - {"type": "assert_malformed", "line": 955, "filename": "binary.111.wasm", "text": "zero byte expected", "module_type": "binary"}, - {"type": "assert_malformed", "line": 974, "filename": "binary.112.wasm", "text": "zero byte expected", "module_type": "binary"}, - {"type": "assert_malformed", "line": 993, "filename": "binary.113.wasm", "text": "zero byte expected", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1011, "filename": "binary.114.wasm", "text": "zero byte expected", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1029, "filename": "binary.115.wasm", "text": "zero byte expected", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1048, "filename": "binary.116.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1065, "filename": "binary.117.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1082, "filename": "binary.118.wasm", "text": "too many locals", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1098, "filename": "binary.119.wasm", "text": "too many locals", "module_type": "binary"}, - {"type": "module", "line": 1116, "filename": "binary.120.wasm"}, - {"type": "assert_malformed", "line": 1132, "filename": "binary.121.wasm", "text": "function and code section have inconsistent lengths", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1142, "filename": "binary.122.wasm", "text": "function and code section have inconsistent lengths", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1151, "filename": "binary.123.wasm", "text": "function and code section have inconsistent lengths", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1162, "filename": "binary.124.wasm", "text": "function and code section have inconsistent lengths", "module_type": "binary"}, - {"type": "module", "line": 1172, "filename": "binary.125.wasm"}, - {"type": "module", "line": 1178, "filename": "binary.126.wasm"}, - {"type": "assert_malformed", "line": 1185, "filename": "binary.127.wasm", "text": "data count and data section have inconsistent lengths", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1195, "filename": "binary.128.wasm", "text": "data count and data section have inconsistent lengths", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1205, "filename": "binary.129.wasm", "text": "data count section required", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1227, "filename": "binary.130.wasm", "text": "data count section required", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1246, "filename": "binary.131.wasm", "text": "illegal opcode", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1272, "filename": "binary.132.wasm", "text": "malformed reference type", "module_type": "binary"}, - {"type": "module", "line": 1297, "filename": "binary.133.wasm"}, - {"type": "module", "line": 1321, "filename": "binary.134.wasm"}, - {"type": "module", "line": 1346, "filename": "binary.135.wasm"}, - {"type": "assert_malformed", "line": 1353, "filename": "binary.136.wasm", "text": "length out of bounds", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1364, "filename": "binary.137.wasm", "text": "section size mismatch", "module_type": "binary"}, - {"type": "module", "line": 1374, "filename": "binary.138.wasm"}, - {"type": "assert_malformed", "line": 1383, "filename": "binary.139.wasm", "text": "malformed import kind", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1393, "filename": "binary.140.wasm", "text": "malformed import kind", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1404, "filename": "binary.141.wasm", "text": "malformed import kind", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1414, "filename": "binary.142.wasm", "text": "malformed import kind", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1425, "filename": "binary.143.wasm", "text": "malformed import kind", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1435, "filename": "binary.144.wasm", "text": "malformed import kind", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1448, "filename": "binary.145.wasm", "text": "unexpected end of section or function", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1467, "filename": "binary.146.wasm", "text": "section size mismatch", "module_type": "binary"}, - {"type": "module", "line": 1491, "filename": "binary.147.wasm"}, - {"type": "assert_malformed", "line": 1498, "filename": "binary.148.wasm", "text": "unexpected end of section or function", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1508, "filename": "binary.149.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1517, "filename": "binary.150.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1527, "filename": "binary.151.wasm", "text": "integer representation too long", "module_type": "binary"}, - {"type": "module", "line": 1538, "filename": "binary.152.wasm"}, - {"type": "assert_malformed", "line": 1545, "filename": "binary.153.wasm", "text": "unexpected end of section or function", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1555, "filename": "binary.154.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1563, "filename": "binary.155.wasm", "text": "integer too large", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1572, "filename": "binary.156.wasm", "text": "integer representation too long", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1581, "filename": "binary.157.wasm", "text": "integer representation too long", "module_type": "binary"}, - {"type": "module", "line": 1591, "filename": "binary.158.wasm"}, - {"type": "assert_malformed", "line": 1598, "filename": "binary.159.wasm", "text": "unexpected end of section or function", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1609, "filename": "binary.160.wasm", "text": "section size mismatch", "module_type": "binary"}, - {"type": "module", "line": 1619, "filename": "binary.161.wasm"}, - {"type": "assert_malformed", "line": 1632, "filename": "binary.162.wasm", "text": "length out of bounds", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1653, "filename": "binary.163.wasm", "text": "section size mismatch", "module_type": "binary"}, - {"type": "module", "line": 1673, "filename": "binary.164.wasm"}, - {"type": "assert_malformed", "line": 1687, "filename": "binary.165.wasm", "text": "unexpected end", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1703, "filename": "binary.166.wasm", "text": "unexpected end", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1720, "filename": "binary.167.wasm", "text": "section size mismatch", "module_type": "binary"}, - {"type": "module", "line": 1737, "filename": "binary.168.wasm"}, - {"type": "assert_malformed", "line": 1746, "filename": "binary.169.wasm", "text": "unexpected end of section or function", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1759, "filename": "binary.170.wasm", "text": "section size mismatch", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1772, "filename": "binary.171.wasm", "text": "unexpected end of section or function", "module_type": "binary"}, - {"type": "assert_malformed", "line": 1786, "filename": "binary.172.wasm", "text": "section size mismatch", "module_type": "binary"}, - {"type": "module", "line": 1799, "filename": "binary.173.wasm"}, - {"type": "assert_malformed", "line": 1817, "filename": "binary.174.wasm", "text": "unexpected end", "module_type": "binary"}, - {"type": "module", "line": 1838, "filename": "binary.175.wasm"}, - {"type": "assert_malformed", "line": 1852, "filename": "binary.176.wasm", "text": "unexpected content after last section", "module_type": "binary"}]} + {"type": "assert_malformed", "line": 56, "filename": "binary.37.wasm", "text": "END opcode expected", "module_type": "binary"}, + {"type": "assert_malformed", "line": 77, "filename": "binary.38.wasm", "text": "unexpected end of section or function", "module_type": "binary"}, + {"type": "assert_malformed", "line": 93, "filename": "binary.39.wasm", "text": "section size mismatch", "module_type": "binary"}, + {"type": "assert_malformed", "line": 113, "filename": "binary.40.wasm", "text": "illegal opcode", "module_type": "binary"}, + {"type": "assert_malformed", "line": 126, "filename": "binary.41.wasm", "text": "zero byte expected", "module_type": "binary"}, + {"type": "assert_malformed", "line": 146, "filename": "binary.42.wasm", "text": "zero byte expected", "module_type": "binary"}, + {"type": "assert_malformed", "line": 166, "filename": "binary.43.wasm", "text": "zero byte expected", "module_type": "binary"}, + {"type": "assert_malformed", "line": 185, "filename": "binary.44.wasm", "text": "zero byte expected", "module_type": "binary"}, + {"type": "assert_malformed", "line": 204, "filename": "binary.45.wasm", "text": "zero byte expected", "module_type": "binary"}, + {"type": "assert_malformed", "line": 224, "filename": "binary.46.wasm", "text": "zero byte expected", "module_type": "binary"}, + {"type": "assert_malformed", "line": 243, "filename": "binary.47.wasm", "text": "zero byte expected", "module_type": "binary"}, + {"type": "assert_malformed", "line": 262, "filename": "binary.48.wasm", "text": "zero byte expected", "module_type": "binary"}, + {"type": "assert_malformed", "line": 280, "filename": "binary.49.wasm", "text": "zero byte expected", "module_type": "binary"}, + {"type": "assert_malformed", "line": 298, "filename": "binary.50.wasm", "text": "zero byte expected", "module_type": "binary"}, + {"type": "assert_malformed", "line": 317, "filename": "binary.51.wasm", "text": "integer too large", "module_type": "binary"}, + {"type": "assert_malformed", "line": 334, "filename": "binary.52.wasm", "text": "integer too large", "module_type": "binary"}, + {"type": "assert_malformed", "line": 351, "filename": "binary.53.wasm", "text": "too many locals", "module_type": "binary"}, + {"type": "assert_malformed", "line": 367, "filename": "binary.54.wasm", "text": "too many locals", "module_type": "binary"}, + {"type": "module", "line": 385, "filename": "binary.55.wasm"}, + {"type": "assert_malformed", "line": 401, "filename": "binary.56.wasm", "text": "function and code section have inconsistent lengths", "module_type": "binary"}, + {"type": "assert_malformed", "line": 411, "filename": "binary.57.wasm", "text": "function and code section have inconsistent lengths", "module_type": "binary"}, + {"type": "assert_malformed", "line": 420, "filename": "binary.58.wasm", "text": "function and code section have inconsistent lengths", "module_type": "binary"}, + {"type": "assert_malformed", "line": 431, "filename": "binary.59.wasm", "text": "function and code section have inconsistent lengths", "module_type": "binary"}, + {"type": "module", "line": 441, "filename": "binary.60.wasm"}, + {"type": "module", "line": 447, "filename": "binary.61.wasm"}, + {"type": "assert_malformed", "line": 454, "filename": "binary.62.wasm", "text": "data count and data section have inconsistent lengths", "module_type": "binary"}, + {"type": "assert_malformed", "line": 464, "filename": "binary.63.wasm", "text": "data count and data section have inconsistent lengths", "module_type": "binary"}, + {"type": "assert_malformed", "line": 474, "filename": "binary.64.wasm", "text": "data count section required", "module_type": "binary"}, + {"type": "assert_malformed", "line": 496, "filename": "binary.65.wasm", "text": "data count section required", "module_type": "binary"}, + {"type": "assert_malformed", "line": 515, "filename": "binary.66.wasm", "text": "illegal opcode", "module_type": "binary"}, + {"type": "assert_malformed", "line": 541, "filename": "binary.67.wasm", "text": "malformed reference type", "module_type": "binary"}, + {"type": "module", "line": 566, "filename": "binary.68.wasm"}, + {"type": "module", "line": 590, "filename": "binary.69.wasm"}, + {"type": "module", "line": 615, "filename": "binary.70.wasm"}, + {"type": "assert_malformed", "line": 622, "filename": "binary.71.wasm", "text": "length out of bounds", "module_type": "binary"}, + {"type": "assert_malformed", "line": 633, "filename": "binary.72.wasm", "text": "section size mismatch", "module_type": "binary"}, + {"type": "module", "line": 643, "filename": "binary.73.wasm"}, + {"type": "assert_malformed", "line": 652, "filename": "binary.74.wasm", "text": "malformed import kind", "module_type": "binary"}, + {"type": "assert_malformed", "line": 662, "filename": "binary.75.wasm", "text": "malformed import kind", "module_type": "binary"}, + {"type": "assert_malformed", "line": 673, "filename": "binary.76.wasm", "text": "malformed import kind", "module_type": "binary"}, + {"type": "assert_malformed", "line": 683, "filename": "binary.77.wasm", "text": "malformed import kind", "module_type": "binary"}, + {"type": "assert_malformed", "line": 694, "filename": "binary.78.wasm", "text": "malformed import kind", "module_type": "binary"}, + {"type": "assert_malformed", "line": 704, "filename": "binary.79.wasm", "text": "malformed import kind", "module_type": "binary"}, + {"type": "assert_malformed", "line": 717, "filename": "binary.80.wasm", "text": "unexpected end of section or function", "module_type": "binary"}, + {"type": "assert_malformed", "line": 736, "filename": "binary.81.wasm", "text": "section size mismatch", "module_type": "binary"}, + {"type": "module", "line": 760, "filename": "binary.82.wasm"}, + {"type": "assert_malformed", "line": 767, "filename": "binary.83.wasm", "text": "unexpected end of section or function", "module_type": "binary"}, + {"type": "assert_malformed", "line": 777, "filename": "binary.84.wasm", "text": "integer too large", "module_type": "binary"}, + {"type": "assert_malformed", "line": 786, "filename": "binary.85.wasm", "text": "integer too large", "module_type": "binary"}, + {"type": "assert_malformed", "line": 796, "filename": "binary.86.wasm", "text": "integer representation too long", "module_type": "binary"}, + {"type": "module", "line": 807, "filename": "binary.87.wasm"}, + {"type": "assert_malformed", "line": 814, "filename": "binary.88.wasm", "text": "unexpected end of section or function", "module_type": "binary"}, + {"type": "assert_malformed", "line": 824, "filename": "binary.89.wasm", "text": "integer too large", "module_type": "binary"}, + {"type": "assert_malformed", "line": 832, "filename": "binary.90.wasm", "text": "integer too large", "module_type": "binary"}, + {"type": "assert_malformed", "line": 841, "filename": "binary.91.wasm", "text": "integer representation too long", "module_type": "binary"}, + {"type": "assert_malformed", "line": 850, "filename": "binary.92.wasm", "text": "integer representation too long", "module_type": "binary"}, + {"type": "module", "line": 860, "filename": "binary.93.wasm"}, + {"type": "assert_malformed", "line": 867, "filename": "binary.94.wasm", "text": "unexpected end of section or function", "module_type": "binary"}, + {"type": "assert_malformed", "line": 878, "filename": "binary.95.wasm", "text": "section size mismatch", "module_type": "binary"}, + {"type": "module", "line": 888, "filename": "binary.96.wasm"}, + {"type": "assert_malformed", "line": 901, "filename": "binary.97.wasm", "text": "length out of bounds", "module_type": "binary"}, + {"type": "assert_malformed", "line": 922, "filename": "binary.98.wasm", "text": "section size mismatch", "module_type": "binary"}, + {"type": "module", "line": 942, "filename": "binary.99.wasm"}, + {"type": "assert_malformed", "line": 956, "filename": "binary.100.wasm", "text": "unexpected end", "module_type": "binary"}, + {"type": "assert_malformed", "line": 972, "filename": "binary.101.wasm", "text": "unexpected end", "module_type": "binary"}, + {"type": "assert_malformed", "line": 989, "filename": "binary.102.wasm", "text": "section size mismatch", "module_type": "binary"}, + {"type": "module", "line": 1006, "filename": "binary.103.wasm"}, + {"type": "assert_malformed", "line": 1015, "filename": "binary.104.wasm", "text": "unexpected end of section or function", "module_type": "binary"}, + {"type": "assert_malformed", "line": 1028, "filename": "binary.105.wasm", "text": "section size mismatch", "module_type": "binary"}, + {"type": "assert_malformed", "line": 1041, "filename": "binary.106.wasm", "text": "unexpected end of section or function", "module_type": "binary"}, + {"type": "assert_malformed", "line": 1055, "filename": "binary.107.wasm", "text": "section size mismatch", "module_type": "binary"}, + {"type": "module", "line": 1068, "filename": "binary.108.wasm"}, + {"type": "assert_malformed", "line": 1086, "filename": "binary.109.wasm", "text": "unexpected end", "module_type": "binary"}, + {"type": "module", "line": 1107, "filename": "binary.110.wasm"}, + {"type": "assert_malformed", "line": 1121, "filename": "binary.111.wasm", "text": "unexpected content after last section", "module_type": "binary"}]} diff --git a/internal/integration_test/spectest/v2/testdata/binary.wast b/internal/integration_test/spectest/v2/testdata/binary.wast index 1b6b4712..c777bebb 100644 --- a/internal/integration_test/spectest/v2/testdata/binary.wast +++ b/internal/integration_test/spectest/v2/testdata/binary.wast @@ -45,373 +45,11 @@ (assert_malformed (module binary "\00asm\00\00\00\01") "unknown binary version") ;; Invalid section id. -(assert_malformed (module binary "\00asm" "\01\00\00\00" "\0d\00") "malformed section id") -(assert_malformed (module binary "\00asm" "\01\00\00\00" "\7f\00") "malformed section id") -(assert_malformed (module binary "\00asm" "\01\00\00\00" "\80\00\01\00") "malformed section id") -(assert_malformed (module binary "\00asm" "\01\00\00\00" "\81\00\01\00") "malformed section id") -(assert_malformed (module binary "\00asm" "\01\00\00\00" "\ff\00\01\00") "malformed section id") - -;; Unsigned LEB128 can have non-minimal length -(module binary - "\00asm" "\01\00\00\00" - "\05\04\01" ;; Memory section with 1 entry - "\00\82\00" ;; no max, minimum 2 -) -(module binary - "\00asm" "\01\00\00\00" - "\05\07\01" ;; Memory section with 1 entry - "\00\82\80\80\80\00" ;; no max, minimum 2 -) - -;; Signed LEB128 can have non-minimal length -(module binary - "\00asm" "\01\00\00\00" - "\06\07\01" ;; Global section with 1 entry - "\7f\00" ;; i32, immutable - "\41\80\00" ;; i32.const 0 - "\0b" ;; end -) -(module binary - "\00asm" "\01\00\00\00" - "\06\07\01" ;; Global section with 1 entry - "\7f\00" ;; i32, immutable - "\41\ff\7f" ;; i32.const -1 - "\0b" ;; end -) -(module binary - "\00asm" "\01\00\00\00" - "\06\0a\01" ;; Global section with 1 entry - "\7f\00" ;; i32, immutable - "\41\80\80\80\80\00" ;; i32.const 0 - "\0b" ;; end -) -(module binary - "\00asm" "\01\00\00\00" - "\06\0a\01" ;; Global section with 1 entry - "\7f\00" ;; i32, immutable - "\41\ff\ff\ff\ff\7f" ;; i32.const -1 - "\0b" ;; end -) - -(module binary - "\00asm" "\01\00\00\00" - "\06\07\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\80\00" ;; i64.const 0 with unused bits set - "\0b" ;; end -) -(module binary - "\00asm" "\01\00\00\00" - "\06\07\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\ff\7f" ;; i64.const -1 with unused bits unset - "\0b" ;; end -) -(module binary - "\00asm" "\01\00\00\00" - "\06\0f\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\80\80\80\80\80\80\80\80\80\00" ;; i64.const 0 with unused bits set - "\0b" ;; end -) -(module binary - "\00asm" "\01\00\00\00" - "\06\0f\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\ff\ff\ff\ff\ff\ff\ff\ff\ff\7f" ;; i64.const -1 with unused bits unset - "\0b" ;; end -) - -(module binary - "\00asm" "\01\00\00\00" - "\05\03\01" ;; Memory section with 1 entry - "\00\00" ;; no max, minimum 0 - "\0b\06\01" ;; Data section with 1 entry - "\00" ;; Memory index 0 - "\41\00\0b\00" ;; (i32.const 0) with contents "" -) - -(module binary - "\00asm" "\01\00\00\00" - "\04\04\01" ;; Table section with 1 entry - "\70\00\00" ;; no max, minimum 0, funcref - "\09\06\01" ;; Element section with 1 entry - "\00" ;; Table index 0 - "\41\00\0b\00" ;; (i32.const 0) with no elements -) - -;; Data segment tags and memory index can have non-minimal length -(module binary - "\00asm" "\01\00\00\00" - "\05\03\01" ;; Memory section with 1 entry - "\00\00" ;; no max, minimum 0 - "\0b\07\01" ;; Data section with 1 entry - "\80\00" ;; Active segment, encoded with 2 bytes - "\41\00\0b\00" ;; (i32.const 0) with contents "" -) -(module binary - "\00asm" "\01\00\00\00" - "\05\03\01" ;; Memory section with 1 entry - "\00\00" ;; no max, minimum 0 - "\0b\08\01" ;; Data section with 1 entry - "\82\00" ;; Active segment, encoded with 2 bytes - "\00" ;; explicit memory index - "\41\00\0b\00" ;; (i32.const 0) with contents "" -) -(module binary - "\00asm" "\01\00\00\00" - "\05\03\01" ;; Memory section with 1 entry - "\00\00" ;; no max, minimum 0 - "\0b\09\01" ;; Data section with 1 entry - "\82\00" ;; Active segment, encoded with 2 bytes - "\80\00" ;; explicit memory index, encoded with 2 bytes - "\41\00\0b\00" ;; (i32.const 0) with contents "" -) - -;; Element segment tags and table index can have non-minimal length -(module binary - "\00asm" "\01\00\00\00" - "\04\04\01" ;; Table section with 1 entry - "\70\00\00" ;; no max, minimum 0, funcref - "\09\07\01" ;; Element section with 1 entry - "\80\00" ;; Active segment - "\41\00\0b\00" ;; (i32.const 0) with no elements -) -(module binary - "\00asm" "\01\00\00\00" - "\04\04\01" ;; Table section with 1 entry - "\70\00\00" ;; no max, minimum 0, funcref - "\09\09\01" ;; Element section with 1 entry - "\02" ;; Active segment - "\80\00" ;; explicit table index, encoded with 2 bytes - "\41\00\0b\00\00" ;; (i32.const 0) with no elements -) -(module binary - "\00asm" "\01\00\00\00" - "\04\04\01" ;; Table section with 1 entry - "\70\00\00" ;; no max, minimum 0, funcref - "\09\09\01" ;; Element section with 1 entry - "\82\00" ;; Active segment, encoded with 2 bytes - "\00" ;; explicit table index - "\41\00\0b\00\00" ;; (i32.const 0) with no elements -) -(module binary - "\00asm" "\01\00\00\00" - "\04\04\01" ;; Table section with 1 entry - "\70\00\00" ;; no max, minimum 0, funcref - "\09\0a\01" ;; Element section with 1 entry - "\82\00" ;; Active segment, encoded with 2 bytes - "\80\00" ;; explicit table index, encoded with 2 bytes - "\41\00\0b\00\00" ;; (i32.const 0) with no elements -) - -;; Type section with signed LEB128 encoded type -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\01" ;; Type section id - "\05" ;; Type section length - "\01" ;; Types vector length - "\e0\7f" ;; Malformed functype, -0x20 in signed LEB128 encoding - "\00\00" - ) - "integer representation too long" -) - -;; Unsigned LEB128 must not be overlong -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\05\08\01" ;; Memory section with 1 entry - "\00\82\80\80\80\80\00" ;; no max, minimum 2 with one byte too many - ) - "integer representation too long" -) - -;; Signed LEB128 must not be overlong -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0b\01" ;; Global section with 1 entry - "\7f\00" ;; i32, immutable - "\41\80\80\80\80\80\00" ;; i32.const 0 with one byte too many - "\0b" ;; end - ) - "integer representation too long" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0b\01" ;; Global section with 1 entry - "\7f\00" ;; i32, immutable - "\41\ff\ff\ff\ff\ff\7f" ;; i32.const -1 with one byte too many - "\0b" ;; end - ) - "integer representation too long" -) - -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\10\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\80\80\80\80\80\80\80\80\80\80\00" ;; i64.const 0 with one byte too many - "\0b" ;; end - ) - "integer representation too long" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\10\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\ff\ff\ff\ff\ff\ff\ff\ff\ff\ff\7f" ;; i64.const -1 with one byte too many - "\0b" ;; end - ) - "integer representation too long" -) - -;; Unsigned LEB128s zero-extend -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\05\07\01" ;; Memory section with 1 entry - "\00\82\80\80\80\70" ;; no max, minimum 2 with unused bits set - ) - "integer too large" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\05\07\01" ;; Memory section with 1 entry - "\00\82\80\80\80\40" ;; no max, minimum 2 with some unused bits set - ) - "integer too large" -) - -;; Signed LEB128s sign-extend -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0a\01" ;; Global section with 1 entry - "\7f\00" ;; i32, immutable - "\41\80\80\80\80\70" ;; i32.const 0 with unused bits set - "\0b" ;; end - ) - "integer too large" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0a\01" ;; Global section with 1 entry - "\7f\00" ;; i32, immutable - "\41\ff\ff\ff\ff\0f" ;; i32.const -1 with unused bits unset - "\0b" ;; end - ) - "integer too large" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0a\01" ;; Global section with 1 entry - "\7f\00" ;; i32, immutable - "\41\80\80\80\80\1f" ;; i32.const 0 with some unused bits set - "\0b" ;; end - ) - "integer too large" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0a\01" ;; Global section with 1 entry - "\7f\00" ;; i32, immutable - "\41\ff\ff\ff\ff\4f" ;; i32.const -1 with some unused bits unset - "\0b" ;; end - ) - "integer too large" -) - -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0f\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\80\80\80\80\80\80\80\80\80\7e" ;; i64.const 0 with unused bits set - "\0b" ;; end - ) - "integer too large" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0f\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\ff\ff\ff\ff\ff\ff\ff\ff\ff\01" ;; i64.const -1 with unused bits unset - "\0b" ;; end - ) - "integer too large" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0f\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\80\80\80\80\80\80\80\80\80\02" ;; i64.const 0 with some unused bits set - "\0b" ;; end - ) - "integer too large" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0f\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\ff\ff\ff\ff\ff\ff\ff\ff\ff\41" ;; i64.const -1 with some unused bits unset - "\0b" ;; end - ) - "integer too large" -) - -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0f\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\80\80\80\80\80\80\80\80\80\7e" ;; i64.const 0 with unused bits set - "\0b" ;; end - ) - "integer too large" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0f\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\ff\ff\ff\ff\ff\ff\ff\ff\ff\01" ;; i64.const -1 with unused bits unset - "\0b" ;; end - ) - "integer too large" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0f\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\80\80\80\80\80\80\80\80\80\02" ;; i64.const 0 with some unused bits set - "\0b" ;; end - ) - "integer too large" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0f\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\ff\ff\ff\ff\ff\ff\ff\ff\ff\41" ;; i64.const -1 with some unused bits unset - "\0b" ;; end - ) - "integer too large" -) +(assert_malformed (module binary "\00asm" "\01\00\00\00" "\0e\01\00") "malformed section id") +(assert_malformed (module binary "\00asm" "\01\00\00\00" "\7f\01\00") "malformed section id") +(assert_malformed (module binary "\00asm" "\01\00\00\00" "\80\01\00\01\01\00") "malformed section id") +(assert_malformed (module binary "\00asm" "\01\00\00\00" "\81\01\00\01\01\00") "malformed section id") +(assert_malformed (module binary "\00asm" "\01\00\00\00" "\ff\01\00\01\01\00") "malformed section id") ;; Function with missing end marker (between two functions) (assert_malformed @@ -470,386 +108,17 @@ "section size mismatch" ) -;; Unsigned LEB128 must not be overlong +;; Init expression with missing end marker (assert_malformed (module binary "\00asm" "\01\00\00\00" - "\05\08\01" ;; Memory section with 1 entry - "\00\82\80\80\80\80\00" ;; no max, minimum 2 with one byte too many + "\01\04\01\60\00\00" ;; Type section: 1 type + "\03\02\01\00" ;; Function section: 1 function + "\06\05\01\7f\00\41\00" ;; Global section: 1 entry with missing end marker + ;; Missing end marker here + "\0a\04\01\02\00\0b" ;; Code section: 1 function ) - "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" -) -(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 - "\82\80\80\80\80\00" ;; alignment 2 with one byte too many - "\00" ;; offset 0 - "\1a" ;; drop - "\0b" ;; end - ) - "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 - "\82\80\80\80\80\00" ;; alignment 2 with one byte too many - "\03" ;; offset 3 - "\0b" ;; end - ) - "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" -) - -;; Signed LEB128 must not be overlong -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0b\01" ;; Global section with 1 entry - "\7f\00" ;; i32, immutable - "\41\80\80\80\80\80\00" ;; i32.const 0 with one byte too many - "\0b" ;; end - ) - "integer representation too long" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0b\01" ;; Global section with 1 entry - "\7f\00" ;; i32, immutable - "\41\ff\ff\ff\ff\ff\7f" ;; i32.const -1 with one byte too many - "\0b" ;; end - ) - "integer representation too long" -) - -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\10\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\80\80\80\80\80\80\80\80\80\80\00" ;; i64.const 0 with one byte too many - "\0b" ;; end - ) - "integer representation too long" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\10\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\ff\ff\ff\ff\ff\ff\ff\ff\ff\ff\7f" ;; i64.const -1 with one byte too many - "\0b" ;; end - ) - "integer representation too long" -) - -;; Unsigned LEB128s zero-extend -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\05\07\01" ;; Memory section with 1 entry - "\00\82\80\80\80\70" ;; no max, minimum 2 with unused bits set - ) - "integer too large" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\05\07\01" ;; Memory section with 1 entry - "\00\82\80\80\80\40" ;; no max, minimum 2 with some unused bits set - ) - "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" -) -(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 - "\0e\01\01" ;; local type count - "\7f" ;; i32 - "\41\00" ;; i32.const 0 - "\28" ;; i32.load - "\82\80\80\80\10" ;; alignment 2 with unused bits set - "\00" ;; offset 0 - "\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 - "\82\80\80\80\40" ;; alignment 2 with some unused bits set - "\00" ;; offset 0 - "\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\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 - "\82\80\80\80\10" ;; alignment 2 with unused bits set - "\03" ;; offset 3 - "\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 - "\82\80\80\80\40" ;; alignment 2 with some unused bits set - "\03" ;; offset 3 - "\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\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 - (module binary - "\00asm" "\01\00\00\00" - "\06\0a\01" ;; Global section with 1 entry - "\7f\00" ;; i32, immutable - "\41\80\80\80\80\70" ;; i32.const 0 with unused bits set - "\0b" ;; end - ) - "integer too large" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0a\01" ;; Global section with 1 entry - "\7f\00" ;; i32, immutable - "\41\ff\ff\ff\ff\0f" ;; i32.const -1 with unused bits unset - "\0b" ;; end - ) - "integer too large" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0a\01" ;; Global section with 1 entry - "\7f\00" ;; i32, immutable - "\41\80\80\80\80\1f" ;; i32.const 0 with some unused bits set - "\0b" ;; end - ) - "integer too large" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0a\01" ;; Global section with 1 entry - "\7f\00" ;; i32, immutable - "\41\ff\ff\ff\ff\4f" ;; i32.const -1 with some unused bits unset - "\0b" ;; end - ) - "integer too large" -) - -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0f\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\80\80\80\80\80\80\80\80\80\7e" ;; i64.const 0 with unused bits set - "\0b" ;; end - ) - "integer too large" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0f\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\ff\ff\ff\ff\ff\ff\ff\ff\ff\01" ;; i64.const -1 with unused bits unset - "\0b" ;; end - ) - "integer too large" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0f\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\80\80\80\80\80\80\80\80\80\02" ;; i64.const 0 with some unused bits set - "\0b" ;; end - ) - "integer too large" -) -(assert_malformed - (module binary - "\00asm" "\01\00\00\00" - "\06\0f\01" ;; Global section with 1 entry - "\7e\00" ;; i64, immutable - "\42\ff\ff\ff\ff\ff\ff\ff\ff\ff\41" ;; i64.const -1 with some unused bits unset - "\0b" ;; end - ) - "integer too large" + "illegal opcode" ) ;; memory.grow reserved byte equal to zero. diff --git a/internal/integration_test/spectest/v2/testdata/br_table.0.wasm b/internal/integration_test/spectest/v2/testdata/br_table.0.wasm index f8e168b6..8cc09b53 100644 Binary files a/internal/integration_test/spectest/v2/testdata/br_table.0.wasm and b/internal/integration_test/spectest/v2/testdata/br_table.0.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/br_table.json b/internal/integration_test/spectest/v2/testdata/br_table.json index c3e31411..601513fd 100644 --- a/internal/integration_test/spectest/v2/testdata/br_table.json +++ b/internal/integration_test/spectest/v2/testdata/br_table.json @@ -1,176 +1,176 @@ {"source_filename": "./br_table.wast", "commands": [ {"type": "module", "line": 3, "filename": "br_table.0.wasm"}, - {"type": "assert_return", "line": 1256, "action": {"type": "invoke", "field": "type-i32", "args": []}, "expected": []}, - {"type": "assert_return", "line": 1257, "action": {"type": "invoke", "field": "type-i64", "args": []}, "expected": []}, - {"type": "assert_return", "line": 1258, "action": {"type": "invoke", "field": "type-f32", "args": []}, "expected": []}, - {"type": "assert_return", "line": 1259, "action": {"type": "invoke", "field": "type-f64", "args": []}, "expected": []}, - {"type": "assert_return", "line": 1261, "action": {"type": "invoke", "field": "type-i32-value", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, - {"type": "assert_return", "line": 1262, "action": {"type": "invoke", "field": "type-i64-value", "args": []}, "expected": [{"type": "i64", "value": "2"}]}, - {"type": "assert_return", "line": 1263, "action": {"type": "invoke", "field": "type-f32-value", "args": []}, "expected": [{"type": "f32", "value": "1077936128"}]}, - {"type": "assert_return", "line": 1264, "action": {"type": "invoke", "field": "type-f64-value", "args": []}, "expected": [{"type": "f64", "value": "4616189618054758400"}]}, - {"type": "assert_return", "line": 1266, "action": {"type": "invoke", "field": "empty", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "22"}]}, - {"type": "assert_return", "line": 1267, "action": {"type": "invoke", "field": "empty", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "22"}]}, - {"type": "assert_return", "line": 1268, "action": {"type": "invoke", "field": "empty", "args": [{"type": "i32", "value": "11"}]}, "expected": [{"type": "i32", "value": "22"}]}, - {"type": "assert_return", "line": 1269, "action": {"type": "invoke", "field": "empty", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "22"}]}, - {"type": "assert_return", "line": 1270, "action": {"type": "invoke", "field": "empty", "args": [{"type": "i32", "value": "4294967196"}]}, "expected": [{"type": "i32", "value": "22"}]}, - {"type": "assert_return", "line": 1271, "action": {"type": "invoke", "field": "empty", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "22"}]}, - {"type": "assert_return", "line": 1273, "action": {"type": "invoke", "field": "empty-value", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "33"}]}, - {"type": "assert_return", "line": 1274, "action": {"type": "invoke", "field": "empty-value", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "33"}]}, - {"type": "assert_return", "line": 1275, "action": {"type": "invoke", "field": "empty-value", "args": [{"type": "i32", "value": "11"}]}, "expected": [{"type": "i32", "value": "33"}]}, - {"type": "assert_return", "line": 1276, "action": {"type": "invoke", "field": "empty-value", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "33"}]}, - {"type": "assert_return", "line": 1277, "action": {"type": "invoke", "field": "empty-value", "args": [{"type": "i32", "value": "4294967196"}]}, "expected": [{"type": "i32", "value": "33"}]}, - {"type": "assert_return", "line": 1278, "action": {"type": "invoke", "field": "empty-value", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "33"}]}, - {"type": "assert_return", "line": 1280, "action": {"type": "invoke", "field": "singleton", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "22"}]}, - {"type": "assert_return", "line": 1281, "action": {"type": "invoke", "field": "singleton", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "20"}]}, - {"type": "assert_return", "line": 1282, "action": {"type": "invoke", "field": "singleton", "args": [{"type": "i32", "value": "11"}]}, "expected": [{"type": "i32", "value": "20"}]}, - {"type": "assert_return", "line": 1283, "action": {"type": "invoke", "field": "singleton", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "20"}]}, - {"type": "assert_return", "line": 1284, "action": {"type": "invoke", "field": "singleton", "args": [{"type": "i32", "value": "4294967196"}]}, "expected": [{"type": "i32", "value": "20"}]}, - {"type": "assert_return", "line": 1285, "action": {"type": "invoke", "field": "singleton", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "20"}]}, - {"type": "assert_return", "line": 1287, "action": {"type": "invoke", "field": "singleton-value", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "32"}]}, - {"type": "assert_return", "line": 1288, "action": {"type": "invoke", "field": "singleton-value", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "33"}]}, - {"type": "assert_return", "line": 1289, "action": {"type": "invoke", "field": "singleton-value", "args": [{"type": "i32", "value": "11"}]}, "expected": [{"type": "i32", "value": "33"}]}, - {"type": "assert_return", "line": 1290, "action": {"type": "invoke", "field": "singleton-value", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "33"}]}, - {"type": "assert_return", "line": 1291, "action": {"type": "invoke", "field": "singleton-value", "args": [{"type": "i32", "value": "4294967196"}]}, "expected": [{"type": "i32", "value": "33"}]}, - {"type": "assert_return", "line": 1292, "action": {"type": "invoke", "field": "singleton-value", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "33"}]}, - {"type": "assert_return", "line": 1294, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "103"}]}, - {"type": "assert_return", "line": 1295, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "102"}]}, - {"type": "assert_return", "line": 1296, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "101"}]}, - {"type": "assert_return", "line": 1297, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "i32", "value": "100"}]}, - {"type": "assert_return", "line": 1298, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "4"}]}, "expected": [{"type": "i32", "value": "104"}]}, - {"type": "assert_return", "line": 1299, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "5"}]}, "expected": [{"type": "i32", "value": "104"}]}, - {"type": "assert_return", "line": 1300, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "104"}]}, - {"type": "assert_return", "line": 1301, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "10"}]}, "expected": [{"type": "i32", "value": "104"}]}, - {"type": "assert_return", "line": 1302, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "104"}]}, - {"type": "assert_return", "line": 1303, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "104"}]}, - {"type": "assert_return", "line": 1305, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "213"}]}, - {"type": "assert_return", "line": 1306, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "212"}]}, - {"type": "assert_return", "line": 1307, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "211"}]}, - {"type": "assert_return", "line": 1308, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "i32", "value": "210"}]}, - {"type": "assert_return", "line": 1309, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "4"}]}, "expected": [{"type": "i32", "value": "214"}]}, - {"type": "assert_return", "line": 1310, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "5"}]}, "expected": [{"type": "i32", "value": "214"}]}, - {"type": "assert_return", "line": 1311, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "214"}]}, - {"type": "assert_return", "line": 1312, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "10"}]}, "expected": [{"type": "i32", "value": "214"}]}, - {"type": "assert_return", "line": 1313, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "214"}]}, - {"type": "assert_return", "line": 1314, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "214"}]}, - {"type": "assert_return", "line": 1316, "action": {"type": "invoke", "field": "large", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "0"}]}, - {"type": "assert_return", "line": 1317, "action": {"type": "invoke", "field": "large", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "1"}]}, - {"type": "assert_return", "line": 1318, "action": {"type": "invoke", "field": "large", "args": [{"type": "i32", "value": "100"}]}, "expected": [{"type": "i32", "value": "0"}]}, - {"type": "assert_return", "line": 1319, "action": {"type": "invoke", "field": "large", "args": [{"type": "i32", "value": "101"}]}, "expected": [{"type": "i32", "value": "1"}]}, - {"type": "assert_return", "line": 1320, "action": {"type": "invoke", "field": "large", "args": [{"type": "i32", "value": "10000"}]}, "expected": [{"type": "i32", "value": "0"}]}, - {"type": "assert_return", "line": 1321, "action": {"type": "invoke", "field": "large", "args": [{"type": "i32", "value": "10001"}]}, "expected": [{"type": "i32", "value": "1"}]}, - {"type": "assert_return", "line": 1322, "action": {"type": "invoke", "field": "large", "args": [{"type": "i32", "value": "1000000"}]}, "expected": [{"type": "i32", "value": "1"}]}, - {"type": "assert_return", "line": 1323, "action": {"type": "invoke", "field": "large", "args": [{"type": "i32", "value": "1000001"}]}, "expected": [{"type": "i32", "value": "1"}]}, - {"type": "assert_return", "line": 1325, "action": {"type": "invoke", "field": "as-block-first", "args": []}, "expected": []}, - {"type": "assert_return", "line": 1326, "action": {"type": "invoke", "field": "as-block-mid", "args": []}, "expected": []}, - {"type": "assert_return", "line": 1327, "action": {"type": "invoke", "field": "as-block-last", "args": []}, "expected": []}, - {"type": "assert_return", "line": 1328, "action": {"type": "invoke", "field": "as-block-value", "args": []}, "expected": [{"type": "i32", "value": "2"}]}, - {"type": "assert_return", "line": 1330, "action": {"type": "invoke", "field": "as-loop-first", "args": []}, "expected": [{"type": "i32", "value": "3"}]}, - {"type": "assert_return", "line": 1331, "action": {"type": "invoke", "field": "as-loop-mid", "args": []}, "expected": [{"type": "i32", "value": "4"}]}, - {"type": "assert_return", "line": 1332, "action": {"type": "invoke", "field": "as-loop-last", "args": []}, "expected": [{"type": "i32", "value": "5"}]}, - {"type": "assert_return", "line": 1334, "action": {"type": "invoke", "field": "as-br-value", "args": []}, "expected": [{"type": "i32", "value": "9"}]}, - {"type": "assert_return", "line": 1336, "action": {"type": "invoke", "field": "as-br_if-cond", "args": []}, "expected": []}, - {"type": "assert_return", "line": 1337, "action": {"type": "invoke", "field": "as-br_if-value", "args": []}, "expected": [{"type": "i32", "value": "8"}]}, - {"type": "assert_return", "line": 1338, "action": {"type": "invoke", "field": "as-br_if-value-cond", "args": []}, "expected": [{"type": "i32", "value": "9"}]}, - {"type": "assert_return", "line": 1340, "action": {"type": "invoke", "field": "as-br_table-index", "args": []}, "expected": []}, - {"type": "assert_return", "line": 1341, "action": {"type": "invoke", "field": "as-br_table-value", "args": []}, "expected": [{"type": "i32", "value": "10"}]}, - {"type": "assert_return", "line": 1342, "action": {"type": "invoke", "field": "as-br_table-value-index", "args": []}, "expected": [{"type": "i32", "value": "11"}]}, - {"type": "assert_return", "line": 1344, "action": {"type": "invoke", "field": "as-return-value", "args": []}, "expected": [{"type": "i64", "value": "7"}]}, - {"type": "assert_return", "line": 1346, "action": {"type": "invoke", "field": "as-if-cond", "args": []}, "expected": [{"type": "i32", "value": "2"}]}, - {"type": "assert_return", "line": 1347, "action": {"type": "invoke", "field": "as-if-then", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "3"}]}, - {"type": "assert_return", "line": 1348, "action": {"type": "invoke", "field": "as-if-then", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "6"}]}, - {"type": "assert_return", "line": 1349, "action": {"type": "invoke", "field": "as-if-else", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "4"}]}, - {"type": "assert_return", "line": 1350, "action": {"type": "invoke", "field": "as-if-else", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "6"}]}, - {"type": "assert_return", "line": 1352, "action": {"type": "invoke", "field": "as-select-first", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "5"}]}, - {"type": "assert_return", "line": 1353, "action": {"type": "invoke", "field": "as-select-first", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "5"}]}, - {"type": "assert_return", "line": 1354, "action": {"type": "invoke", "field": "as-select-second", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "6"}]}, - {"type": "assert_return", "line": 1355, "action": {"type": "invoke", "field": "as-select-second", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "6"}]}, - {"type": "assert_return", "line": 1356, "action": {"type": "invoke", "field": "as-select-cond", "args": []}, "expected": [{"type": "i32", "value": "7"}]}, - {"type": "assert_return", "line": 1358, "action": {"type": "invoke", "field": "as-call-first", "args": []}, "expected": [{"type": "i32", "value": "12"}]}, - {"type": "assert_return", "line": 1359, "action": {"type": "invoke", "field": "as-call-mid", "args": []}, "expected": [{"type": "i32", "value": "13"}]}, - {"type": "assert_return", "line": 1360, "action": {"type": "invoke", "field": "as-call-last", "args": []}, "expected": [{"type": "i32", "value": "14"}]}, - {"type": "assert_return", "line": 1362, "action": {"type": "invoke", "field": "as-call_indirect-first", "args": []}, "expected": [{"type": "i32", "value": "20"}]}, - {"type": "assert_return", "line": 1363, "action": {"type": "invoke", "field": "as-call_indirect-mid", "args": []}, "expected": [{"type": "i32", "value": "21"}]}, - {"type": "assert_return", "line": 1364, "action": {"type": "invoke", "field": "as-call_indirect-last", "args": []}, "expected": [{"type": "i32", "value": "22"}]}, - {"type": "assert_return", "line": 1365, "action": {"type": "invoke", "field": "as-call_indirect-func", "args": []}, "expected": [{"type": "i32", "value": "23"}]}, - {"type": "assert_return", "line": 1367, "action": {"type": "invoke", "field": "as-local.set-value", "args": []}, "expected": [{"type": "i32", "value": "17"}]}, - {"type": "assert_return", "line": 1368, "action": {"type": "invoke", "field": "as-local.tee-value", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, - {"type": "assert_return", "line": 1369, "action": {"type": "invoke", "field": "as-global.set-value", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, - {"type": "assert_return", "line": 1371, "action": {"type": "invoke", "field": "as-load-address", "args": []}, "expected": [{"type": "f32", "value": "1071225242"}]}, - {"type": "assert_return", "line": 1372, "action": {"type": "invoke", "field": "as-loadN-address", "args": []}, "expected": [{"type": "i64", "value": "30"}]}, - {"type": "assert_return", "line": 1374, "action": {"type": "invoke", "field": "as-store-address", "args": []}, "expected": [{"type": "i32", "value": "30"}]}, - {"type": "assert_return", "line": 1375, "action": {"type": "invoke", "field": "as-store-value", "args": []}, "expected": [{"type": "i32", "value": "31"}]}, - {"type": "assert_return", "line": 1376, "action": {"type": "invoke", "field": "as-storeN-address", "args": []}, "expected": [{"type": "i32", "value": "32"}]}, - {"type": "assert_return", "line": 1377, "action": {"type": "invoke", "field": "as-storeN-value", "args": []}, "expected": [{"type": "i32", "value": "33"}]}, - {"type": "assert_return", "line": 1379, "action": {"type": "invoke", "field": "as-unary-operand", "args": []}, "expected": [{"type": "f32", "value": "1079613850"}]}, - {"type": "assert_return", "line": 1381, "action": {"type": "invoke", "field": "as-binary-left", "args": []}, "expected": [{"type": "i32", "value": "3"}]}, - {"type": "assert_return", "line": 1382, "action": {"type": "invoke", "field": "as-binary-right", "args": []}, "expected": [{"type": "i64", "value": "45"}]}, - {"type": "assert_return", "line": 1384, "action": {"type": "invoke", "field": "as-test-operand", "args": []}, "expected": [{"type": "i32", "value": "44"}]}, - {"type": "assert_return", "line": 1386, "action": {"type": "invoke", "field": "as-compare-left", "args": []}, "expected": [{"type": "i32", "value": "43"}]}, - {"type": "assert_return", "line": 1387, "action": {"type": "invoke", "field": "as-compare-right", "args": []}, "expected": [{"type": "i32", "value": "42"}]}, - {"type": "assert_return", "line": 1389, "action": {"type": "invoke", "field": "as-convert-operand", "args": []}, "expected": [{"type": "i32", "value": "41"}]}, - {"type": "assert_return", "line": 1391, "action": {"type": "invoke", "field": "as-memory.grow-size", "args": []}, "expected": [{"type": "i32", "value": "40"}]}, - {"type": "assert_return", "line": 1393, "action": {"type": "invoke", "field": "nested-block-value", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "19"}]}, - {"type": "assert_return", "line": 1394, "action": {"type": "invoke", "field": "nested-block-value", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "17"}]}, - {"type": "assert_return", "line": 1395, "action": {"type": "invoke", "field": "nested-block-value", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "16"}]}, - {"type": "assert_return", "line": 1396, "action": {"type": "invoke", "field": "nested-block-value", "args": [{"type": "i32", "value": "10"}]}, "expected": [{"type": "i32", "value": "16"}]}, - {"type": "assert_return", "line": 1397, "action": {"type": "invoke", "field": "nested-block-value", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "16"}]}, - {"type": "assert_return", "line": 1398, "action": {"type": "invoke", "field": "nested-block-value", "args": [{"type": "i32", "value": "100000"}]}, "expected": [{"type": "i32", "value": "16"}]}, - {"type": "assert_return", "line": 1400, "action": {"type": "invoke", "field": "nested-br-value", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "8"}]}, - {"type": "assert_return", "line": 1401, "action": {"type": "invoke", "field": "nested-br-value", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "9"}]}, - {"type": "assert_return", "line": 1402, "action": {"type": "invoke", "field": "nested-br-value", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "17"}]}, - {"type": "assert_return", "line": 1403, "action": {"type": "invoke", "field": "nested-br-value", "args": [{"type": "i32", "value": "11"}]}, "expected": [{"type": "i32", "value": "17"}]}, - {"type": "assert_return", "line": 1404, "action": {"type": "invoke", "field": "nested-br-value", "args": [{"type": "i32", "value": "4294967292"}]}, "expected": [{"type": "i32", "value": "17"}]}, - {"type": "assert_return", "line": 1405, "action": {"type": "invoke", "field": "nested-br-value", "args": [{"type": "i32", "value": "10213210"}]}, "expected": [{"type": "i32", "value": "17"}]}, - {"type": "assert_return", "line": 1407, "action": {"type": "invoke", "field": "nested-br_if-value", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "17"}]}, - {"type": "assert_return", "line": 1408, "action": {"type": "invoke", "field": "nested-br_if-value", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "9"}]}, - {"type": "assert_return", "line": 1409, "action": {"type": "invoke", "field": "nested-br_if-value", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "8"}]}, - {"type": "assert_return", "line": 1410, "action": {"type": "invoke", "field": "nested-br_if-value", "args": [{"type": "i32", "value": "9"}]}, "expected": [{"type": "i32", "value": "8"}]}, - {"type": "assert_return", "line": 1411, "action": {"type": "invoke", "field": "nested-br_if-value", "args": [{"type": "i32", "value": "4294967287"}]}, "expected": [{"type": "i32", "value": "8"}]}, - {"type": "assert_return", "line": 1412, "action": {"type": "invoke", "field": "nested-br_if-value", "args": [{"type": "i32", "value": "999999"}]}, "expected": [{"type": "i32", "value": "8"}]}, - {"type": "assert_return", "line": 1414, "action": {"type": "invoke", "field": "nested-br_if-value-cond", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "9"}]}, - {"type": "assert_return", "line": 1415, "action": {"type": "invoke", "field": "nested-br_if-value-cond", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "8"}]}, - {"type": "assert_return", "line": 1416, "action": {"type": "invoke", "field": "nested-br_if-value-cond", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "9"}]}, - {"type": "assert_return", "line": 1417, "action": {"type": "invoke", "field": "nested-br_if-value-cond", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "i32", "value": "9"}]}, - {"type": "assert_return", "line": 1418, "action": {"type": "invoke", "field": "nested-br_if-value-cond", "args": [{"type": "i32", "value": "4293967296"}]}, "expected": [{"type": "i32", "value": "9"}]}, - {"type": "assert_return", "line": 1419, "action": {"type": "invoke", "field": "nested-br_if-value-cond", "args": [{"type": "i32", "value": "9423975"}]}, "expected": [{"type": "i32", "value": "9"}]}, - {"type": "assert_return", "line": 1421, "action": {"type": "invoke", "field": "nested-br_table-value", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "17"}]}, - {"type": "assert_return", "line": 1422, "action": {"type": "invoke", "field": "nested-br_table-value", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "9"}]}, - {"type": "assert_return", "line": 1423, "action": {"type": "invoke", "field": "nested-br_table-value", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "8"}]}, - {"type": "assert_return", "line": 1424, "action": {"type": "invoke", "field": "nested-br_table-value", "args": [{"type": "i32", "value": "9"}]}, "expected": [{"type": "i32", "value": "8"}]}, - {"type": "assert_return", "line": 1425, "action": {"type": "invoke", "field": "nested-br_table-value", "args": [{"type": "i32", "value": "4294967287"}]}, "expected": [{"type": "i32", "value": "8"}]}, - {"type": "assert_return", "line": 1426, "action": {"type": "invoke", "field": "nested-br_table-value", "args": [{"type": "i32", "value": "999999"}]}, "expected": [{"type": "i32", "value": "8"}]}, - {"type": "assert_return", "line": 1428, "action": {"type": "invoke", "field": "nested-br_table-value-index", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "9"}]}, - {"type": "assert_return", "line": 1429, "action": {"type": "invoke", "field": "nested-br_table-value-index", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "8"}]}, - {"type": "assert_return", "line": 1430, "action": {"type": "invoke", "field": "nested-br_table-value-index", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "9"}]}, - {"type": "assert_return", "line": 1431, "action": {"type": "invoke", "field": "nested-br_table-value-index", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "i32", "value": "9"}]}, - {"type": "assert_return", "line": 1432, "action": {"type": "invoke", "field": "nested-br_table-value-index", "args": [{"type": "i32", "value": "4293967296"}]}, "expected": [{"type": "i32", "value": "9"}]}, - {"type": "assert_return", "line": 1433, "action": {"type": "invoke", "field": "nested-br_table-value-index", "args": [{"type": "i32", "value": "9423975"}]}, "expected": [{"type": "i32", "value": "9"}]}, - {"type": "assert_return", "line": 1435, "action": {"type": "invoke", "field": "nested-br_table-loop-block", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "3"}]}, - {"type": "assert_return", "line": 1437, "action": {"type": "invoke", "field": "meet-externref", "args": [{"type": "i32", "value": "0"}, {"type": "externref", "value": "1"}]}, "expected": [{"type": "externref", "value": "1"}]}, - {"type": "assert_return", "line": 1438, "action": {"type": "invoke", "field": "meet-externref", "args": [{"type": "i32", "value": "1"}, {"type": "externref", "value": "1"}]}, "expected": [{"type": "externref", "value": "1"}]}, - {"type": "assert_return", "line": 1439, "action": {"type": "invoke", "field": "meet-externref", "args": [{"type": "i32", "value": "2"}, {"type": "externref", "value": "1"}]}, "expected": [{"type": "externref", "value": "1"}]}, - {"type": "assert_invalid", "line": 1442, "filename": "br_table.1.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1449, "filename": "br_table.2.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1456, "filename": "br_table.3.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1462, "filename": "br_table.4.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1470, "filename": "br_table.5.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1481, "filename": "br_table.6.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1492, "filename": "br_table.7.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1498, "filename": "br_table.8.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1504, "filename": "br_table.9.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1510, "filename": "br_table.10.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1516, "filename": "br_table.11.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1525, "filename": "br_table.12.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1532, "filename": "br_table.13.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1544, "filename": "br_table.14.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1556, "filename": "br_table.15.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1567, "filename": "br_table.16.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1579, "filename": "br_table.17.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1591, "filename": "br_table.18.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1605, "filename": "br_table.19.wasm", "text": "unknown label", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1611, "filename": "br_table.20.wasm", "text": "unknown label", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1617, "filename": "br_table.21.wasm", "text": "unknown label", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1624, "filename": "br_table.22.wasm", "text": "unknown label", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1630, "filename": "br_table.23.wasm", "text": "unknown label", "module_type": "binary"}, - {"type": "assert_invalid", "line": 1636, "filename": "br_table.24.wasm", "text": "unknown label", "module_type": "binary"}]} + {"type": "assert_return", "line": 1007, "action": {"type": "invoke", "field": "type-i32", "args": []}, "expected": []}, + {"type": "assert_return", "line": 1008, "action": {"type": "invoke", "field": "type-i64", "args": []}, "expected": []}, + {"type": "assert_return", "line": 1009, "action": {"type": "invoke", "field": "type-f32", "args": []}, "expected": []}, + {"type": "assert_return", "line": 1010, "action": {"type": "invoke", "field": "type-f64", "args": []}, "expected": []}, + {"type": "assert_return", "line": 1012, "action": {"type": "invoke", "field": "type-i32-value", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "assert_return", "line": 1013, "action": {"type": "invoke", "field": "type-i64-value", "args": []}, "expected": [{"type": "i64", "value": "2"}]}, + {"type": "assert_return", "line": 1014, "action": {"type": "invoke", "field": "type-f32-value", "args": []}, "expected": [{"type": "f32", "value": "1077936128"}]}, + {"type": "assert_return", "line": 1015, "action": {"type": "invoke", "field": "type-f64-value", "args": []}, "expected": [{"type": "f64", "value": "4616189618054758400"}]}, + {"type": "assert_return", "line": 1017, "action": {"type": "invoke", "field": "empty", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "22"}]}, + {"type": "assert_return", "line": 1018, "action": {"type": "invoke", "field": "empty", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "22"}]}, + {"type": "assert_return", "line": 1019, "action": {"type": "invoke", "field": "empty", "args": [{"type": "i32", "value": "11"}]}, "expected": [{"type": "i32", "value": "22"}]}, + {"type": "assert_return", "line": 1020, "action": {"type": "invoke", "field": "empty", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "22"}]}, + {"type": "assert_return", "line": 1021, "action": {"type": "invoke", "field": "empty", "args": [{"type": "i32", "value": "4294967196"}]}, "expected": [{"type": "i32", "value": "22"}]}, + {"type": "assert_return", "line": 1022, "action": {"type": "invoke", "field": "empty", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "22"}]}, + {"type": "assert_return", "line": 1024, "action": {"type": "invoke", "field": "empty-value", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "33"}]}, + {"type": "assert_return", "line": 1025, "action": {"type": "invoke", "field": "empty-value", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "33"}]}, + {"type": "assert_return", "line": 1026, "action": {"type": "invoke", "field": "empty-value", "args": [{"type": "i32", "value": "11"}]}, "expected": [{"type": "i32", "value": "33"}]}, + {"type": "assert_return", "line": 1027, "action": {"type": "invoke", "field": "empty-value", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "33"}]}, + {"type": "assert_return", "line": 1028, "action": {"type": "invoke", "field": "empty-value", "args": [{"type": "i32", "value": "4294967196"}]}, "expected": [{"type": "i32", "value": "33"}]}, + {"type": "assert_return", "line": 1029, "action": {"type": "invoke", "field": "empty-value", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "33"}]}, + {"type": "assert_return", "line": 1031, "action": {"type": "invoke", "field": "singleton", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "22"}]}, + {"type": "assert_return", "line": 1032, "action": {"type": "invoke", "field": "singleton", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "20"}]}, + {"type": "assert_return", "line": 1033, "action": {"type": "invoke", "field": "singleton", "args": [{"type": "i32", "value": "11"}]}, "expected": [{"type": "i32", "value": "20"}]}, + {"type": "assert_return", "line": 1034, "action": {"type": "invoke", "field": "singleton", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "20"}]}, + {"type": "assert_return", "line": 1035, "action": {"type": "invoke", "field": "singleton", "args": [{"type": "i32", "value": "4294967196"}]}, "expected": [{"type": "i32", "value": "20"}]}, + {"type": "assert_return", "line": 1036, "action": {"type": "invoke", "field": "singleton", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "20"}]}, + {"type": "assert_return", "line": 1038, "action": {"type": "invoke", "field": "singleton-value", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "32"}]}, + {"type": "assert_return", "line": 1039, "action": {"type": "invoke", "field": "singleton-value", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "33"}]}, + {"type": "assert_return", "line": 1040, "action": {"type": "invoke", "field": "singleton-value", "args": [{"type": "i32", "value": "11"}]}, "expected": [{"type": "i32", "value": "33"}]}, + {"type": "assert_return", "line": 1041, "action": {"type": "invoke", "field": "singleton-value", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "33"}]}, + {"type": "assert_return", "line": 1042, "action": {"type": "invoke", "field": "singleton-value", "args": [{"type": "i32", "value": "4294967196"}]}, "expected": [{"type": "i32", "value": "33"}]}, + {"type": "assert_return", "line": 1043, "action": {"type": "invoke", "field": "singleton-value", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "33"}]}, + {"type": "assert_return", "line": 1045, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "103"}]}, + {"type": "assert_return", "line": 1046, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "102"}]}, + {"type": "assert_return", "line": 1047, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "101"}]}, + {"type": "assert_return", "line": 1048, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "i32", "value": "100"}]}, + {"type": "assert_return", "line": 1049, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "4"}]}, "expected": [{"type": "i32", "value": "104"}]}, + {"type": "assert_return", "line": 1050, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "5"}]}, "expected": [{"type": "i32", "value": "104"}]}, + {"type": "assert_return", "line": 1051, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "104"}]}, + {"type": "assert_return", "line": 1052, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "10"}]}, "expected": [{"type": "i32", "value": "104"}]}, + {"type": "assert_return", "line": 1053, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "104"}]}, + {"type": "assert_return", "line": 1054, "action": {"type": "invoke", "field": "multiple", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "104"}]}, + {"type": "assert_return", "line": 1056, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "213"}]}, + {"type": "assert_return", "line": 1057, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "212"}]}, + {"type": "assert_return", "line": 1058, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "211"}]}, + {"type": "assert_return", "line": 1059, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "i32", "value": "210"}]}, + {"type": "assert_return", "line": 1060, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "4"}]}, "expected": [{"type": "i32", "value": "214"}]}, + {"type": "assert_return", "line": 1061, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "5"}]}, "expected": [{"type": "i32", "value": "214"}]}, + {"type": "assert_return", "line": 1062, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "214"}]}, + {"type": "assert_return", "line": 1063, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "10"}]}, "expected": [{"type": "i32", "value": "214"}]}, + {"type": "assert_return", "line": 1064, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "214"}]}, + {"type": "assert_return", "line": 1065, "action": {"type": "invoke", "field": "multiple-value", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "214"}]}, + {"type": "assert_return", "line": 1067, "action": {"type": "invoke", "field": "large", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "0"}]}, + {"type": "assert_return", "line": 1068, "action": {"type": "invoke", "field": "large", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "assert_return", "line": 1069, "action": {"type": "invoke", "field": "large", "args": [{"type": "i32", "value": "100"}]}, "expected": [{"type": "i32", "value": "0"}]}, + {"type": "assert_return", "line": 1070, "action": {"type": "invoke", "field": "large", "args": [{"type": "i32", "value": "101"}]}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "assert_return", "line": 1071, "action": {"type": "invoke", "field": "large", "args": [{"type": "i32", "value": "10000"}]}, "expected": [{"type": "i32", "value": "0"}]}, + {"type": "assert_return", "line": 1072, "action": {"type": "invoke", "field": "large", "args": [{"type": "i32", "value": "10001"}]}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "assert_return", "line": 1073, "action": {"type": "invoke", "field": "large", "args": [{"type": "i32", "value": "1000000"}]}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "assert_return", "line": 1074, "action": {"type": "invoke", "field": "large", "args": [{"type": "i32", "value": "1000001"}]}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "assert_return", "line": 1076, "action": {"type": "invoke", "field": "as-block-first", "args": []}, "expected": []}, + {"type": "assert_return", "line": 1077, "action": {"type": "invoke", "field": "as-block-mid", "args": []}, "expected": []}, + {"type": "assert_return", "line": 1078, "action": {"type": "invoke", "field": "as-block-last", "args": []}, "expected": []}, + {"type": "assert_return", "line": 1079, "action": {"type": "invoke", "field": "as-block-value", "args": []}, "expected": [{"type": "i32", "value": "2"}]}, + {"type": "assert_return", "line": 1081, "action": {"type": "invoke", "field": "as-loop-first", "args": []}, "expected": [{"type": "i32", "value": "3"}]}, + {"type": "assert_return", "line": 1082, "action": {"type": "invoke", "field": "as-loop-mid", "args": []}, "expected": [{"type": "i32", "value": "4"}]}, + {"type": "assert_return", "line": 1083, "action": {"type": "invoke", "field": "as-loop-last", "args": []}, "expected": [{"type": "i32", "value": "5"}]}, + {"type": "assert_return", "line": 1085, "action": {"type": "invoke", "field": "as-br-value", "args": []}, "expected": [{"type": "i32", "value": "9"}]}, + {"type": "assert_return", "line": 1087, "action": {"type": "invoke", "field": "as-br_if-cond", "args": []}, "expected": []}, + {"type": "assert_return", "line": 1088, "action": {"type": "invoke", "field": "as-br_if-value", "args": []}, "expected": [{"type": "i32", "value": "8"}]}, + {"type": "assert_return", "line": 1089, "action": {"type": "invoke", "field": "as-br_if-value-cond", "args": []}, "expected": [{"type": "i32", "value": "9"}]}, + {"type": "assert_return", "line": 1091, "action": {"type": "invoke", "field": "as-br_table-index", "args": []}, "expected": []}, + {"type": "assert_return", "line": 1092, "action": {"type": "invoke", "field": "as-br_table-value", "args": []}, "expected": [{"type": "i32", "value": "10"}]}, + {"type": "assert_return", "line": 1093, "action": {"type": "invoke", "field": "as-br_table-value-index", "args": []}, "expected": [{"type": "i32", "value": "11"}]}, + {"type": "assert_return", "line": 1095, "action": {"type": "invoke", "field": "as-return-value", "args": []}, "expected": [{"type": "i64", "value": "7"}]}, + {"type": "assert_return", "line": 1097, "action": {"type": "invoke", "field": "as-if-cond", "args": []}, "expected": [{"type": "i32", "value": "2"}]}, + {"type": "assert_return", "line": 1098, "action": {"type": "invoke", "field": "as-if-then", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "3"}]}, + {"type": "assert_return", "line": 1099, "action": {"type": "invoke", "field": "as-if-then", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "6"}]}, + {"type": "assert_return", "line": 1100, "action": {"type": "invoke", "field": "as-if-else", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "4"}]}, + {"type": "assert_return", "line": 1101, "action": {"type": "invoke", "field": "as-if-else", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "6"}]}, + {"type": "assert_return", "line": 1103, "action": {"type": "invoke", "field": "as-select-first", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "5"}]}, + {"type": "assert_return", "line": 1104, "action": {"type": "invoke", "field": "as-select-first", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "5"}]}, + {"type": "assert_return", "line": 1105, "action": {"type": "invoke", "field": "as-select-second", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "6"}]}, + {"type": "assert_return", "line": 1106, "action": {"type": "invoke", "field": "as-select-second", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "6"}]}, + {"type": "assert_return", "line": 1107, "action": {"type": "invoke", "field": "as-select-cond", "args": []}, "expected": [{"type": "i32", "value": "7"}]}, + {"type": "assert_return", "line": 1109, "action": {"type": "invoke", "field": "as-call-first", "args": []}, "expected": [{"type": "i32", "value": "12"}]}, + {"type": "assert_return", "line": 1110, "action": {"type": "invoke", "field": "as-call-mid", "args": []}, "expected": [{"type": "i32", "value": "13"}]}, + {"type": "assert_return", "line": 1111, "action": {"type": "invoke", "field": "as-call-last", "args": []}, "expected": [{"type": "i32", "value": "14"}]}, + {"type": "assert_return", "line": 1113, "action": {"type": "invoke", "field": "as-call_indirect-first", "args": []}, "expected": [{"type": "i32", "value": "20"}]}, + {"type": "assert_return", "line": 1114, "action": {"type": "invoke", "field": "as-call_indirect-mid", "args": []}, "expected": [{"type": "i32", "value": "21"}]}, + {"type": "assert_return", "line": 1115, "action": {"type": "invoke", "field": "as-call_indirect-last", "args": []}, "expected": [{"type": "i32", "value": "22"}]}, + {"type": "assert_return", "line": 1116, "action": {"type": "invoke", "field": "as-call_indirect-func", "args": []}, "expected": [{"type": "i32", "value": "23"}]}, + {"type": "assert_return", "line": 1118, "action": {"type": "invoke", "field": "as-local.set-value", "args": []}, "expected": [{"type": "i32", "value": "17"}]}, + {"type": "assert_return", "line": 1119, "action": {"type": "invoke", "field": "as-local.tee-value", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "assert_return", "line": 1120, "action": {"type": "invoke", "field": "as-global.set-value", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "assert_return", "line": 1122, "action": {"type": "invoke", "field": "as-load-address", "args": []}, "expected": [{"type": "f32", "value": "1071225242"}]}, + {"type": "assert_return", "line": 1123, "action": {"type": "invoke", "field": "as-loadN-address", "args": []}, "expected": [{"type": "i64", "value": "30"}]}, + {"type": "assert_return", "line": 1125, "action": {"type": "invoke", "field": "as-store-address", "args": []}, "expected": [{"type": "i32", "value": "30"}]}, + {"type": "assert_return", "line": 1126, "action": {"type": "invoke", "field": "as-store-value", "args": []}, "expected": [{"type": "i32", "value": "31"}]}, + {"type": "assert_return", "line": 1127, "action": {"type": "invoke", "field": "as-storeN-address", "args": []}, "expected": [{"type": "i32", "value": "32"}]}, + {"type": "assert_return", "line": 1128, "action": {"type": "invoke", "field": "as-storeN-value", "args": []}, "expected": [{"type": "i32", "value": "33"}]}, + {"type": "assert_return", "line": 1130, "action": {"type": "invoke", "field": "as-unary-operand", "args": []}, "expected": [{"type": "f32", "value": "1079613850"}]}, + {"type": "assert_return", "line": 1132, "action": {"type": "invoke", "field": "as-binary-left", "args": []}, "expected": [{"type": "i32", "value": "3"}]}, + {"type": "assert_return", "line": 1133, "action": {"type": "invoke", "field": "as-binary-right", "args": []}, "expected": [{"type": "i64", "value": "45"}]}, + {"type": "assert_return", "line": 1135, "action": {"type": "invoke", "field": "as-test-operand", "args": []}, "expected": [{"type": "i32", "value": "44"}]}, + {"type": "assert_return", "line": 1137, "action": {"type": "invoke", "field": "as-compare-left", "args": []}, "expected": [{"type": "i32", "value": "43"}]}, + {"type": "assert_return", "line": 1138, "action": {"type": "invoke", "field": "as-compare-right", "args": []}, "expected": [{"type": "i32", "value": "42"}]}, + {"type": "assert_return", "line": 1140, "action": {"type": "invoke", "field": "as-convert-operand", "args": []}, "expected": [{"type": "i32", "value": "41"}]}, + {"type": "assert_return", "line": 1142, "action": {"type": "invoke", "field": "as-memory.grow-size", "args": []}, "expected": [{"type": "i32", "value": "40"}]}, + {"type": "assert_return", "line": 1144, "action": {"type": "invoke", "field": "nested-block-value", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "19"}]}, + {"type": "assert_return", "line": 1145, "action": {"type": "invoke", "field": "nested-block-value", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "17"}]}, + {"type": "assert_return", "line": 1146, "action": {"type": "invoke", "field": "nested-block-value", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "16"}]}, + {"type": "assert_return", "line": 1147, "action": {"type": "invoke", "field": "nested-block-value", "args": [{"type": "i32", "value": "10"}]}, "expected": [{"type": "i32", "value": "16"}]}, + {"type": "assert_return", "line": 1148, "action": {"type": "invoke", "field": "nested-block-value", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "16"}]}, + {"type": "assert_return", "line": 1149, "action": {"type": "invoke", "field": "nested-block-value", "args": [{"type": "i32", "value": "100000"}]}, "expected": [{"type": "i32", "value": "16"}]}, + {"type": "assert_return", "line": 1151, "action": {"type": "invoke", "field": "nested-br-value", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "8"}]}, + {"type": "assert_return", "line": 1152, "action": {"type": "invoke", "field": "nested-br-value", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "9"}]}, + {"type": "assert_return", "line": 1153, "action": {"type": "invoke", "field": "nested-br-value", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "17"}]}, + {"type": "assert_return", "line": 1154, "action": {"type": "invoke", "field": "nested-br-value", "args": [{"type": "i32", "value": "11"}]}, "expected": [{"type": "i32", "value": "17"}]}, + {"type": "assert_return", "line": 1155, "action": {"type": "invoke", "field": "nested-br-value", "args": [{"type": "i32", "value": "4294967292"}]}, "expected": [{"type": "i32", "value": "17"}]}, + {"type": "assert_return", "line": 1156, "action": {"type": "invoke", "field": "nested-br-value", "args": [{"type": "i32", "value": "10213210"}]}, "expected": [{"type": "i32", "value": "17"}]}, + {"type": "assert_return", "line": 1158, "action": {"type": "invoke", "field": "nested-br_if-value", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "17"}]}, + {"type": "assert_return", "line": 1159, "action": {"type": "invoke", "field": "nested-br_if-value", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "9"}]}, + {"type": "assert_return", "line": 1160, "action": {"type": "invoke", "field": "nested-br_if-value", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "8"}]}, + {"type": "assert_return", "line": 1161, "action": {"type": "invoke", "field": "nested-br_if-value", "args": [{"type": "i32", "value": "9"}]}, "expected": [{"type": "i32", "value": "8"}]}, + {"type": "assert_return", "line": 1162, "action": {"type": "invoke", "field": "nested-br_if-value", "args": [{"type": "i32", "value": "4294967287"}]}, "expected": [{"type": "i32", "value": "8"}]}, + {"type": "assert_return", "line": 1163, "action": {"type": "invoke", "field": "nested-br_if-value", "args": [{"type": "i32", "value": "999999"}]}, "expected": [{"type": "i32", "value": "8"}]}, + {"type": "assert_return", "line": 1165, "action": {"type": "invoke", "field": "nested-br_if-value-cond", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "9"}]}, + {"type": "assert_return", "line": 1166, "action": {"type": "invoke", "field": "nested-br_if-value-cond", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "8"}]}, + {"type": "assert_return", "line": 1167, "action": {"type": "invoke", "field": "nested-br_if-value-cond", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "9"}]}, + {"type": "assert_return", "line": 1168, "action": {"type": "invoke", "field": "nested-br_if-value-cond", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "i32", "value": "9"}]}, + {"type": "assert_return", "line": 1169, "action": {"type": "invoke", "field": "nested-br_if-value-cond", "args": [{"type": "i32", "value": "4293967296"}]}, "expected": [{"type": "i32", "value": "9"}]}, + {"type": "assert_return", "line": 1170, "action": {"type": "invoke", "field": "nested-br_if-value-cond", "args": [{"type": "i32", "value": "9423975"}]}, "expected": [{"type": "i32", "value": "9"}]}, + {"type": "assert_return", "line": 1172, "action": {"type": "invoke", "field": "nested-br_table-value", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "17"}]}, + {"type": "assert_return", "line": 1173, "action": {"type": "invoke", "field": "nested-br_table-value", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "9"}]}, + {"type": "assert_return", "line": 1174, "action": {"type": "invoke", "field": "nested-br_table-value", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "8"}]}, + {"type": "assert_return", "line": 1175, "action": {"type": "invoke", "field": "nested-br_table-value", "args": [{"type": "i32", "value": "9"}]}, "expected": [{"type": "i32", "value": "8"}]}, + {"type": "assert_return", "line": 1176, "action": {"type": "invoke", "field": "nested-br_table-value", "args": [{"type": "i32", "value": "4294967287"}]}, "expected": [{"type": "i32", "value": "8"}]}, + {"type": "assert_return", "line": 1177, "action": {"type": "invoke", "field": "nested-br_table-value", "args": [{"type": "i32", "value": "999999"}]}, "expected": [{"type": "i32", "value": "8"}]}, + {"type": "assert_return", "line": 1179, "action": {"type": "invoke", "field": "nested-br_table-value-index", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "9"}]}, + {"type": "assert_return", "line": 1180, "action": {"type": "invoke", "field": "nested-br_table-value-index", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "8"}]}, + {"type": "assert_return", "line": 1181, "action": {"type": "invoke", "field": "nested-br_table-value-index", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "9"}]}, + {"type": "assert_return", "line": 1182, "action": {"type": "invoke", "field": "nested-br_table-value-index", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "i32", "value": "9"}]}, + {"type": "assert_return", "line": 1183, "action": {"type": "invoke", "field": "nested-br_table-value-index", "args": [{"type": "i32", "value": "4293967296"}]}, "expected": [{"type": "i32", "value": "9"}]}, + {"type": "assert_return", "line": 1184, "action": {"type": "invoke", "field": "nested-br_table-value-index", "args": [{"type": "i32", "value": "9423975"}]}, "expected": [{"type": "i32", "value": "9"}]}, + {"type": "assert_return", "line": 1186, "action": {"type": "invoke", "field": "nested-br_table-loop-block", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "3"}]}, + {"type": "assert_return", "line": 1188, "action": {"type": "invoke", "field": "meet-externref", "args": [{"type": "i32", "value": "0"}, {"type": "externref", "value": "1"}]}, "expected": [{"type": "externref", "value": "1"}]}, + {"type": "assert_return", "line": 1189, "action": {"type": "invoke", "field": "meet-externref", "args": [{"type": "i32", "value": "1"}, {"type": "externref", "value": "1"}]}, "expected": [{"type": "externref", "value": "1"}]}, + {"type": "assert_return", "line": 1190, "action": {"type": "invoke", "field": "meet-externref", "args": [{"type": "i32", "value": "2"}, {"type": "externref", "value": "1"}]}, "expected": [{"type": "externref", "value": "1"}]}, + {"type": "assert_invalid", "line": 1193, "filename": "br_table.1.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1200, "filename": "br_table.2.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1207, "filename": "br_table.3.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1213, "filename": "br_table.4.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1221, "filename": "br_table.5.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1232, "filename": "br_table.6.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1243, "filename": "br_table.7.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1249, "filename": "br_table.8.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1255, "filename": "br_table.9.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1261, "filename": "br_table.10.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1267, "filename": "br_table.11.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1276, "filename": "br_table.12.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1283, "filename": "br_table.13.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1295, "filename": "br_table.14.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1307, "filename": "br_table.15.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1318, "filename": "br_table.16.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1330, "filename": "br_table.17.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1342, "filename": "br_table.18.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1356, "filename": "br_table.19.wasm", "text": "unknown label", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1362, "filename": "br_table.20.wasm", "text": "unknown label", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1368, "filename": "br_table.21.wasm", "text": "unknown label", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1375, "filename": "br_table.22.wasm", "text": "unknown label", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1381, "filename": "br_table.23.wasm", "text": "unknown label", "module_type": "binary"}, + {"type": "assert_invalid", "line": 1387, "filename": "br_table.24.wasm", "text": "unknown label", "module_type": "binary"}]} diff --git a/internal/integration_test/spectest/v2/testdata/br_table.wast b/internal/integration_test/spectest/v2/testdata/br_table.wast index 5c1aa50c..3fc533d5 100644 --- a/internal/integration_test/spectest/v2/testdata/br_table.wast +++ b/internal/integration_test/spectest/v2/testdata/br_table.wast @@ -583,255 +583,6 @@ 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 - 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 - 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 - 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 - 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 - 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 - 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 - 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 - 0 1 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0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 - 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 - 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 - 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 - 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 - 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 - 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 - 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 (local.get 0) ) (return (i32.const -1)) diff --git a/internal/integration_test/spectest/v2/testdata/elem.68.wasm b/internal/integration_test/spectest/v2/testdata/elem.68.wasm new file mode 100644 index 00000000..de641d09 Binary files /dev/null and b/internal/integration_test/spectest/v2/testdata/elem.68.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/elem.69.wasm b/internal/integration_test/spectest/v2/testdata/elem.69.wasm new file mode 100644 index 00000000..ae53007c Binary files /dev/null and b/internal/integration_test/spectest/v2/testdata/elem.69.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/elem.json b/internal/integration_test/spectest/v2/testdata/elem.json index e799231b..410ab69b 100644 --- a/internal/integration_test/spectest/v2/testdata/elem.json +++ b/internal/integration_test/spectest/v2/testdata/elem.json @@ -94,4 +94,8 @@ {"type": "assert_return", "line": 670, "action": {"type": "invoke", "module": "$m", "field": "get", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "externref", "value": "137"}]}, {"type": "module", "line": 672, "filename": "elem.67.wasm"}, {"type": "assert_return", "line": 676, "action": {"type": "invoke", "module": "$m", "field": "get", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "externref", "value": "null"}]}, - {"type": "assert_return", "line": 677, "action": {"type": "invoke", "module": "$m", "field": "get", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "externref", "value": "137"}]}]} + {"type": "assert_return", "line": 677, "action": {"type": "invoke", "module": "$m", "field": "get", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "externref", "value": "137"}]}, + {"type": "module", "line": 681, "name": "$module4", "filename": "elem.68.wasm"}, + {"type": "register", "line": 688, "name": "$module4", "as": "module4"}, + {"type": "module", "line": 690, "filename": "elem.69.wasm"}, + {"type": "assert_return", "line": 700, "action": {"type": "invoke", "field": "call_imported_elem", "args": []}, "expected": [{"type": "i32", "value": "42"}]}]} diff --git a/internal/integration_test/spectest/v2/testdata/elem.wast b/internal/integration_test/spectest/v2/testdata/elem.wast index 5857ae8b..4a399eca 100644 --- a/internal/integration_test/spectest/v2/testdata/elem.wast +++ b/internal/integration_test/spectest/v2/testdata/elem.wast @@ -675,3 +675,26 @@ (assert_return (invoke $m "get" (i32.const 0)) (ref.null extern)) (assert_return (invoke $m "get" (i32.const 1)) (ref.extern 137)) + +;; Initializing a table with imported funcref global + +(module $module4 + (func (result i32) + i32.const 42 + ) + (global (export "f") funcref (ref.func 0)) +) + +(register "module4" $module4) + +(module + (import "module4" "f" (global funcref)) + (type $out-i32 (func (result i32))) + (table 10 funcref) + (elem (offset (i32.const 0)) funcref (global.get 0)) + (func (export "call_imported_elem") (type $out-i32) + (call_indirect (type $out-i32) (i32.const 0)) + ) +) + +(assert_return (invoke "call_imported_elem") (i32.const 42)) diff --git a/internal/integration_test/spectest/v2/testdata/simd_linking.0.wasm b/internal/integration_test/spectest/v2/testdata/simd_linking.0.wasm new file mode 100644 index 00000000..7d55ead7 Binary files /dev/null and b/internal/integration_test/spectest/v2/testdata/simd_linking.0.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/simd_linking.1.wasm b/internal/integration_test/spectest/v2/testdata/simd_linking.1.wasm new file mode 100644 index 00000000..99aad164 Binary files /dev/null and b/internal/integration_test/spectest/v2/testdata/simd_linking.1.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/simd_linking.json b/internal/integration_test/spectest/v2/testdata/simd_linking.json new file mode 100644 index 00000000..aad0a959 --- /dev/null +++ b/internal/integration_test/spectest/v2/testdata/simd_linking.json @@ -0,0 +1,5 @@ +{"source_filename": "./simd_linking.wast", + "commands": [ + {"type": "module", "line": 1, "filename": "simd_linking.0.wasm"}, + {"type": "register", "line": 5, "as": "Mv128"}, + {"type": "module", "line": 7, "filename": "simd_linking.1.wasm"}]} diff --git a/internal/integration_test/spectest/v2/testdata/simd_linking.wast b/internal/integration_test/spectest/v2/testdata/simd_linking.wast new file mode 100644 index 00000000..1a1d1635 --- /dev/null +++ b/internal/integration_test/spectest/v2/testdata/simd_linking.wast @@ -0,0 +1,12 @@ +(module + (global (export "g-v128") v128 (v128.const i64x2 0 0)) + (global (export "mg-v128") (mut v128) (v128.const i64x2 0 0)) +) +(register "Mv128") + +(module + ;; TODO: Reactivate once the fix for https://bugs.chromium.org/p/v8/issues/detail?id=13732 + ;; has made it to the downstream node.js that we use on CI. + ;; (import "Mv128" "g-v128" (global v128)) + (import "Mv128" "mg-v128" (global (mut v128))) +) diff --git a/internal/integration_test/spectest/v2/testdata/table_fill.0.wasm b/internal/integration_test/spectest/v2/testdata/table_fill.0.wasm index 11e177fc..fb9a2acd 100644 Binary files a/internal/integration_test/spectest/v2/testdata/table_fill.0.wasm and b/internal/integration_test/spectest/v2/testdata/table_fill.0.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/table_fill.json b/internal/integration_test/spectest/v2/testdata/table_fill.json index fe572e52..531d1a24 100644 --- a/internal/integration_test/spectest/v2/testdata/table_fill.json +++ b/internal/integration_test/spectest/v2/testdata/table_fill.json @@ -1,47 +1,47 @@ {"source_filename": "./table_fill.wast", "commands": [ {"type": "module", "line": 1, "filename": "table_fill.0.wasm"}, - {"type": "assert_return", "line": 13, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "externref", "value": "null"}]}, - {"type": "assert_return", "line": 14, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "externref", "value": "null"}]}, - {"type": "assert_return", "line": 15, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "externref", "value": "null"}]}, - {"type": "assert_return", "line": 16, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "4"}]}, "expected": [{"type": "externref", "value": "null"}]}, - {"type": "assert_return", "line": 17, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "5"}]}, "expected": [{"type": "externref", "value": "null"}]}, - {"type": "assert_return", "line": 19, "action": {"type": "invoke", "field": "fill", "args": [{"type": "i32", "value": "2"}, {"type": "externref", "value": "1"}, {"type": "i32", "value": "3"}]}, "expected": []}, - {"type": "assert_return", "line": 20, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "externref", "value": "null"}]}, - {"type": "assert_return", "line": 21, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "externref", "value": "1"}]}, - {"type": "assert_return", "line": 22, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "externref", "value": "1"}]}, - {"type": "assert_return", "line": 23, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "4"}]}, "expected": [{"type": "externref", "value": "1"}]}, - {"type": "assert_return", "line": 24, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "5"}]}, "expected": [{"type": "externref", "value": "null"}]}, - {"type": "assert_return", "line": 26, "action": {"type": "invoke", "field": "fill", "args": [{"type": "i32", "value": "4"}, {"type": "externref", "value": "2"}, {"type": "i32", "value": "2"}]}, "expected": []}, - {"type": "assert_return", "line": 27, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "externref", "value": "1"}]}, - {"type": "assert_return", "line": 28, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "4"}]}, "expected": [{"type": "externref", "value": "2"}]}, - {"type": "assert_return", "line": 29, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "5"}]}, "expected": [{"type": "externref", "value": "2"}]}, - {"type": "assert_return", "line": 30, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "6"}]}, "expected": [{"type": "externref", "value": "null"}]}, - {"type": "assert_return", "line": 32, "action": {"type": "invoke", "field": "fill", "args": [{"type": "i32", "value": "4"}, {"type": "externref", "value": "3"}, {"type": "i32", "value": "0"}]}, "expected": []}, - {"type": "assert_return", "line": 33, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "externref", "value": "1"}]}, - {"type": "assert_return", "line": 34, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "4"}]}, "expected": [{"type": "externref", "value": "2"}]}, - {"type": "assert_return", "line": 35, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "5"}]}, "expected": [{"type": "externref", "value": "2"}]}, - {"type": "assert_return", "line": 37, "action": {"type": "invoke", "field": "fill", "args": [{"type": "i32", "value": "8"}, {"type": "externref", "value": "4"}, {"type": "i32", "value": "2"}]}, "expected": []}, - {"type": "assert_return", "line": 38, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "7"}]}, "expected": [{"type": "externref", "value": "null"}]}, - {"type": "assert_return", "line": 39, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "8"}]}, "expected": [{"type": "externref", "value": "4"}]}, - {"type": "assert_return", "line": 40, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "9"}]}, "expected": [{"type": "externref", "value": "4"}]}, - {"type": "assert_return", "line": 42, "action": {"type": "invoke", "field": "fill", "args": [{"type": "i32", "value": "9"}, {"type": "externref", "value": "null"}, {"type": "i32", "value": "1"}]}, "expected": []}, + {"type": "assert_return", "line": 17, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "externref", "value": "null"}]}, + {"type": "assert_return", "line": 18, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "externref", "value": "null"}]}, + {"type": "assert_return", "line": 19, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "externref", "value": "null"}]}, + {"type": "assert_return", "line": 20, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "4"}]}, "expected": [{"type": "externref", "value": "null"}]}, + {"type": "assert_return", "line": 21, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "5"}]}, "expected": [{"type": "externref", "value": "null"}]}, + {"type": "assert_return", "line": 23, "action": {"type": "invoke", "field": "fill", "args": [{"type": "i32", "value": "2"}, {"type": "externref", "value": "1"}, {"type": "i32", "value": "3"}]}, "expected": []}, + {"type": "assert_return", "line": 24, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "externref", "value": "null"}]}, + {"type": "assert_return", "line": 25, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "externref", "value": "1"}]}, + {"type": "assert_return", "line": 26, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "externref", "value": "1"}]}, + {"type": "assert_return", "line": 27, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "4"}]}, "expected": [{"type": "externref", "value": "1"}]}, + {"type": "assert_return", "line": 28, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "5"}]}, "expected": [{"type": "externref", "value": "null"}]}, + {"type": "assert_return", "line": 30, "action": {"type": "invoke", "field": "fill", "args": [{"type": "i32", "value": "4"}, {"type": "externref", "value": "2"}, {"type": "i32", "value": "2"}]}, "expected": []}, + {"type": "assert_return", "line": 31, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "externref", "value": "1"}]}, + {"type": "assert_return", "line": 32, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "4"}]}, "expected": [{"type": "externref", "value": "2"}]}, + {"type": "assert_return", "line": 33, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "5"}]}, "expected": [{"type": "externref", "value": "2"}]}, + {"type": "assert_return", "line": 34, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "6"}]}, "expected": [{"type": "externref", "value": "null"}]}, + {"type": "assert_return", "line": 36, "action": {"type": "invoke", "field": "fill", "args": [{"type": "i32", "value": "4"}, {"type": "externref", "value": "3"}, {"type": "i32", "value": "0"}]}, "expected": []}, + {"type": "assert_return", "line": 37, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "externref", "value": "1"}]}, + {"type": "assert_return", "line": 38, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "4"}]}, "expected": [{"type": "externref", "value": "2"}]}, + {"type": "assert_return", "line": 39, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "5"}]}, "expected": [{"type": "externref", "value": "2"}]}, + {"type": "assert_return", "line": 41, "action": {"type": "invoke", "field": "fill", "args": [{"type": "i32", "value": "8"}, {"type": "externref", "value": "4"}, {"type": "i32", "value": "2"}]}, "expected": []}, + {"type": "assert_return", "line": 42, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "7"}]}, "expected": [{"type": "externref", "value": "null"}]}, {"type": "assert_return", "line": 43, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "8"}]}, "expected": [{"type": "externref", "value": "4"}]}, - {"type": "assert_return", "line": 44, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "9"}]}, "expected": [{"type": "externref", "value": "null"}]}, - {"type": "assert_return", "line": 46, "action": {"type": "invoke", "field": "fill", "args": [{"type": "i32", "value": "10"}, {"type": "externref", "value": "5"}, {"type": "i32", "value": "0"}]}, "expected": []}, - {"type": "assert_return", "line": 47, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "9"}]}, "expected": [{"type": "externref", "value": "null"}]}, - {"type": "assert_trap", "line": 50, "action": {"type": "invoke", "field": "fill", "args": [{"type": "i32", "value": "8"}, {"type": "externref", "value": "6"}, {"type": "i32", "value": "3"}]}, "text": "out of bounds table access", "expected": []}, - {"type": "assert_return", "line": 53, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "7"}]}, "expected": [{"type": "externref", "value": "null"}]}, - {"type": "assert_return", "line": 54, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "8"}]}, "expected": [{"type": "externref", "value": "4"}]}, - {"type": "assert_return", "line": 55, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "9"}]}, "expected": [{"type": "externref", "value": "null"}]}, - {"type": "assert_trap", "line": 58, "action": {"type": "invoke", "field": "fill", "args": [{"type": "i32", "value": "11"}, {"type": "externref", "value": "null"}, {"type": "i32", "value": "0"}]}, "text": "out of bounds table access", "expected": []}, - {"type": "assert_trap", "line": 63, "action": {"type": "invoke", "field": "fill", "args": [{"type": "i32", "value": "11"}, {"type": "externref", "value": "null"}, {"type": "i32", "value": "10"}]}, "text": "out of bounds table access", "expected": []}, - {"type": "assert_invalid", "line": 71, "filename": "table_fill.1.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 80, "filename": "table_fill.2.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 89, "filename": "table_fill.3.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 98, "filename": "table_fill.4.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 107, "filename": "table_fill.5.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 116, "filename": "table_fill.6.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 125, "filename": "table_fill.7.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 135, "filename": "table_fill.8.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 146, "filename": "table_fill.9.wasm", "text": "type mismatch", "module_type": "binary"}]} + {"type": "assert_return", "line": 44, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "9"}]}, "expected": [{"type": "externref", "value": "4"}]}, + {"type": "assert_return", "line": 46, "action": {"type": "invoke", "field": "fill-abbrev", "args": [{"type": "i32", "value": "9"}, {"type": "externref", "value": "null"}, {"type": "i32", "value": "1"}]}, "expected": []}, + {"type": "assert_return", "line": 47, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "8"}]}, "expected": [{"type": "externref", "value": "4"}]}, + {"type": "assert_return", "line": 48, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "9"}]}, "expected": [{"type": "externref", "value": "null"}]}, + {"type": "assert_return", "line": 50, "action": {"type": "invoke", "field": "fill", "args": [{"type": "i32", "value": "10"}, {"type": "externref", "value": "5"}, {"type": "i32", "value": "0"}]}, "expected": []}, + {"type": "assert_return", "line": 51, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "9"}]}, "expected": [{"type": "externref", "value": "null"}]}, + {"type": "assert_trap", "line": 54, "action": {"type": "invoke", "field": "fill", "args": [{"type": "i32", "value": "8"}, {"type": "externref", "value": "6"}, {"type": "i32", "value": "3"}]}, "text": "out of bounds table access", "expected": []}, + {"type": "assert_return", "line": 57, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "7"}]}, "expected": [{"type": "externref", "value": "null"}]}, + {"type": "assert_return", "line": 58, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "8"}]}, "expected": [{"type": "externref", "value": "4"}]}, + {"type": "assert_return", "line": 59, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "9"}]}, "expected": [{"type": "externref", "value": "null"}]}, + {"type": "assert_trap", "line": 62, "action": {"type": "invoke", "field": "fill", "args": [{"type": "i32", "value": "11"}, {"type": "externref", "value": "null"}, {"type": "i32", "value": "0"}]}, "text": "out of bounds table access", "expected": []}, + {"type": "assert_trap", "line": 67, "action": {"type": "invoke", "field": "fill", "args": [{"type": "i32", "value": "11"}, {"type": "externref", "value": "null"}, {"type": "i32", "value": "10"}]}, "text": "out of bounds table access", "expected": []}, + {"type": "assert_invalid", "line": 75, "filename": "table_fill.1.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 84, "filename": "table_fill.2.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 93, "filename": "table_fill.3.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 102, "filename": "table_fill.4.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 111, "filename": "table_fill.5.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 120, "filename": "table_fill.6.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 129, "filename": "table_fill.7.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 139, "filename": "table_fill.8.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 150, "filename": "table_fill.9.wasm", "text": "type mismatch", "module_type": "binary"}]} diff --git a/internal/integration_test/spectest/v2/testdata/table_fill.wast b/internal/integration_test/spectest/v2/testdata/table_fill.wast index 3df64da1..a8e22255 100644 --- a/internal/integration_test/spectest/v2/testdata/table_fill.wast +++ b/internal/integration_test/spectest/v2/testdata/table_fill.wast @@ -5,6 +5,10 @@ (table.fill $t (local.get $i) (local.get $r) (local.get $n)) ) + (func (export "fill-abbrev") (param $i i32) (param $r externref) (param $n i32) + (table.fill (local.get $i) (local.get $r) (local.get $n)) + ) + (func (export "get") (param $i i32) (result externref) (table.get $t (local.get $i)) ) @@ -39,7 +43,7 @@ (assert_return (invoke "get" (i32.const 8)) (ref.extern 4)) (assert_return (invoke "get" (i32.const 9)) (ref.extern 4)) -(assert_return (invoke "fill" (i32.const 9) (ref.null extern) (i32.const 1))) +(assert_return (invoke "fill-abbrev" (i32.const 9) (ref.null extern) (i32.const 1))) (assert_return (invoke "get" (i32.const 8)) (ref.extern 4)) (assert_return (invoke "get" (i32.const 9)) (ref.null extern)) diff --git a/internal/integration_test/spectest/v2/testdata/table_get.wast b/internal/integration_test/spectest/v2/testdata/table_get.wast index 5d57c319..0dedb19f 100644 --- a/internal/integration_test/spectest/v2/testdata/table_get.wast +++ b/internal/integration_test/spectest/v2/testdata/table_get.wast @@ -10,7 +10,7 @@ ) (func (export "get-externref") (param $i i32) (result externref) - (table.get $t2 (local.get $i)) + (table.get (local.get $i)) ) (func $f3 (export "get-funcref") (param $i i32) (result funcref) (table.get $t3 (local.get $i)) diff --git a/internal/integration_test/spectest/v2/testdata/table_grow.0.wasm b/internal/integration_test/spectest/v2/testdata/table_grow.0.wasm index 675ebda6..184954c8 100644 Binary files a/internal/integration_test/spectest/v2/testdata/table_grow.0.wasm and b/internal/integration_test/spectest/v2/testdata/table_grow.0.wasm differ diff --git a/internal/integration_test/spectest/v2/testdata/table_grow.json b/internal/integration_test/spectest/v2/testdata/table_grow.json index 89bb4a3f..47a52aab 100644 --- a/internal/integration_test/spectest/v2/testdata/table_grow.json +++ b/internal/integration_test/spectest/v2/testdata/table_grow.json @@ -1,52 +1,52 @@ {"source_filename": "./table_grow.wast", "commands": [ {"type": "module", "line": 1, "filename": "table_grow.0.wasm"}, - {"type": "assert_return", "line": 13, "action": {"type": "invoke", "field": "size", "args": []}, "expected": [{"type": "i32", "value": "0"}]}, - {"type": "assert_trap", "line": 14, "action": {"type": "invoke", "field": "set", "args": [{"type": "i32", "value": "0"}, {"type": "externref", "value": "2"}]}, "text": "out of bounds table access", "expected": []}, - {"type": "assert_trap", "line": 15, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "0"}]}, "text": "out of bounds table access", "expected": [{"type": "externref"}]}, - {"type": "assert_return", "line": 17, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}, {"type": "externref", "value": "null"}]}, "expected": [{"type": "i32", "value": "0"}]}, - {"type": "assert_return", "line": 18, "action": {"type": "invoke", "field": "size", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, - {"type": "assert_return", "line": 19, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "externref", "value": "null"}]}, - {"type": "assert_return", "line": 20, "action": {"type": "invoke", "field": "set", "args": [{"type": "i32", "value": "0"}, {"type": "externref", "value": "2"}]}, "expected": []}, - {"type": "assert_return", "line": 21, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "externref", "value": "2"}]}, - {"type": "assert_trap", "line": 22, "action": {"type": "invoke", "field": "set", "args": [{"type": "i32", "value": "1"}, {"type": "externref", "value": "2"}]}, "text": "out of bounds table access", "expected": []}, - {"type": "assert_trap", "line": 23, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "1"}]}, "text": "out of bounds table access", "expected": [{"type": "externref"}]}, - {"type": "assert_return", "line": 25, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "4"}, {"type": "externref", "value": "3"}]}, "expected": [{"type": "i32", "value": "1"}]}, - {"type": "assert_return", "line": 26, "action": {"type": "invoke", "field": "size", "args": []}, "expected": [{"type": "i32", "value": "5"}]}, - {"type": "assert_return", "line": 27, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "externref", "value": "2"}]}, - {"type": "assert_return", "line": 28, "action": {"type": "invoke", "field": "set", "args": [{"type": "i32", "value": "0"}, {"type": "externref", "value": "2"}]}, "expected": []}, - {"type": "assert_return", "line": 29, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "externref", "value": "2"}]}, - {"type": "assert_return", "line": 30, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "externref", "value": "3"}]}, - {"type": "assert_return", "line": 31, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "4"}]}, "expected": [{"type": "externref", "value": "3"}]}, - {"type": "assert_return", "line": 32, "action": {"type": "invoke", "field": "set", "args": [{"type": "i32", "value": "4"}, {"type": "externref", "value": "4"}]}, "expected": []}, - {"type": "assert_return", "line": 33, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "4"}]}, "expected": [{"type": "externref", "value": "4"}]}, - {"type": "assert_trap", "line": 34, "action": {"type": "invoke", "field": "set", "args": [{"type": "i32", "value": "5"}, {"type": "externref", "value": "2"}]}, "text": "out of bounds table access", "expected": []}, - {"type": "assert_trap", "line": 35, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "5"}]}, "text": "out of bounds table access", "expected": [{"type": "externref"}]}, - {"type": "module", "line": 39, "filename": "table_grow.1.wasm"}, - {"type": "assert_return", "line": 47, "action": {"type": "invoke", "field": "grow", "args": []}, "expected": [{"type": "i32", "value": "4294967295"}]}, - {"type": "module", "line": 50, "filename": "table_grow.2.wasm"}, - {"type": "assert_return", "line": 57, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "0"}]}, - {"type": "assert_return", "line": 58, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "0"}]}, - {"type": "assert_return", "line": 59, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "1"}]}, - {"type": "assert_return", "line": 60, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "1"}]}, - {"type": "assert_return", "line": 61, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "800"}]}, "expected": [{"type": "i32", "value": "3"}]}, - {"type": "module", "line": 64, "filename": "table_grow.3.wasm"}, - {"type": "assert_return", "line": 71, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "0"}]}, - {"type": "assert_return", "line": 72, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "0"}]}, - {"type": "assert_return", "line": 73, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "1"}]}, - {"type": "assert_return", "line": 74, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "2"}]}, - {"type": "assert_return", "line": 75, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "4"}]}, - {"type": "assert_return", "line": 76, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "10"}]}, - {"type": "assert_return", "line": 77, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "4294967295"}]}, - {"type": "assert_return", "line": 78, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "65536"}]}, "expected": [{"type": "i32", "value": "4294967295"}]}, - {"type": "module", "line": 81, "filename": "table_grow.4.wasm"}, - {"type": "assert_return", "line": 103, "action": {"type": "invoke", "field": "check-table-null", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "9"}]}, "expected": [{"type": "funcref", "value": "null"}]}, - {"type": "assert_return", "line": 104, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "10"}]}, "expected": [{"type": "i32", "value": "10"}]}, - {"type": "assert_return", "line": 105, "action": {"type": "invoke", "field": "check-table-null", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "19"}]}, "expected": [{"type": "funcref", "value": "null"}]}, - {"type": "assert_invalid", "line": 111, "filename": "table_grow.5.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 120, "filename": "table_grow.6.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 129, "filename": "table_grow.7.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 138, "filename": "table_grow.8.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 147, "filename": "table_grow.9.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 157, "filename": "table_grow.10.wasm", "text": "type mismatch", "module_type": "binary"}, - {"type": "assert_invalid", "line": 166, "filename": "table_grow.11.wasm", "text": "type mismatch", "module_type": "binary"}]} + {"type": "assert_return", "line": 16, "action": {"type": "invoke", "field": "size", "args": []}, "expected": [{"type": "i32", "value": "0"}]}, + {"type": "assert_trap", "line": 17, "action": {"type": "invoke", "field": "set", "args": [{"type": "i32", "value": "0"}, {"type": "externref", "value": "2"}]}, "text": "out of bounds table access", "expected": []}, + {"type": "assert_trap", "line": 18, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "0"}]}, "text": "out of bounds table access", "expected": [{"type": "externref"}]}, + {"type": "assert_return", "line": 20, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}, {"type": "externref", "value": "null"}]}, "expected": [{"type": "i32", "value": "0"}]}, + {"type": "assert_return", "line": 21, "action": {"type": "invoke", "field": "size", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "assert_return", "line": 22, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "externref", "value": "null"}]}, + {"type": "assert_return", "line": 23, "action": {"type": "invoke", "field": "set", "args": [{"type": "i32", "value": "0"}, {"type": "externref", "value": "2"}]}, "expected": []}, + {"type": "assert_return", "line": 24, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "externref", "value": "2"}]}, + {"type": "assert_trap", "line": 25, "action": {"type": "invoke", "field": "set", "args": [{"type": "i32", "value": "1"}, {"type": "externref", "value": "2"}]}, "text": "out of bounds table access", "expected": []}, + {"type": "assert_trap", "line": 26, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "1"}]}, "text": "out of bounds table access", "expected": [{"type": "externref"}]}, + {"type": "assert_return", "line": 28, "action": {"type": "invoke", "field": "grow-abbrev", "args": [{"type": "i32", "value": "4"}, {"type": "externref", "value": "3"}]}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "assert_return", "line": 29, "action": {"type": "invoke", "field": "size", "args": []}, "expected": [{"type": "i32", "value": "5"}]}, + {"type": "assert_return", "line": 30, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "externref", "value": "2"}]}, + {"type": "assert_return", "line": 31, "action": {"type": "invoke", "field": "set", "args": [{"type": "i32", "value": "0"}, {"type": "externref", "value": "2"}]}, "expected": []}, + {"type": "assert_return", "line": 32, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "externref", "value": "2"}]}, + {"type": "assert_return", "line": 33, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "externref", "value": "3"}]}, + {"type": "assert_return", "line": 34, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "4"}]}, "expected": [{"type": "externref", "value": "3"}]}, + {"type": "assert_return", "line": 35, "action": {"type": "invoke", "field": "set", "args": [{"type": "i32", "value": "4"}, {"type": "externref", "value": "4"}]}, "expected": []}, + {"type": "assert_return", "line": 36, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "4"}]}, "expected": [{"type": "externref", "value": "4"}]}, + {"type": "assert_trap", "line": 37, "action": {"type": "invoke", "field": "set", "args": [{"type": "i32", "value": "5"}, {"type": "externref", "value": "2"}]}, "text": "out of bounds table access", "expected": []}, + {"type": "assert_trap", "line": 38, "action": {"type": "invoke", "field": "get", "args": [{"type": "i32", "value": "5"}]}, "text": "out of bounds table access", "expected": [{"type": "externref"}]}, + {"type": "module", "line": 42, "filename": "table_grow.1.wasm"}, + {"type": "assert_return", "line": 50, "action": {"type": "invoke", "field": "grow", "args": []}, "expected": [{"type": "i32", "value": "4294967295"}]}, + {"type": "module", "line": 53, "filename": "table_grow.2.wasm"}, + {"type": "assert_return", "line": 60, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "0"}]}, + {"type": "assert_return", "line": 61, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "0"}]}, + {"type": "assert_return", "line": 62, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "assert_return", "line": 63, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "assert_return", "line": 64, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "800"}]}, "expected": [{"type": "i32", "value": "3"}]}, + {"type": "module", "line": 67, "filename": "table_grow.3.wasm"}, + {"type": "assert_return", "line": 74, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "0"}]}, + {"type": "assert_return", "line": 75, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "0"}]}, + {"type": "assert_return", "line": 76, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "assert_return", "line": 77, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "2"}]}, + {"type": "assert_return", "line": 78, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "4"}]}, + {"type": "assert_return", "line": 79, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "10"}]}, + {"type": "assert_return", "line": 80, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "4294967295"}]}, + {"type": "assert_return", "line": 81, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "65536"}]}, "expected": [{"type": "i32", "value": "4294967295"}]}, + {"type": "module", "line": 84, "filename": "table_grow.4.wasm"}, + {"type": "assert_return", "line": 106, "action": {"type": "invoke", "field": "check-table-null", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "9"}]}, "expected": [{"type": "funcref", "value": "null"}]}, + {"type": "assert_return", "line": 107, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "10"}]}, "expected": [{"type": "i32", "value": "10"}]}, + {"type": "assert_return", "line": 108, "action": {"type": "invoke", "field": "check-table-null", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "19"}]}, "expected": [{"type": "funcref", "value": "null"}]}, + {"type": "assert_invalid", "line": 114, "filename": "table_grow.5.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 123, "filename": "table_grow.6.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 132, "filename": "table_grow.7.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 141, "filename": "table_grow.8.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 150, "filename": "table_grow.9.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 160, "filename": "table_grow.10.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 169, "filename": "table_grow.11.wasm", "text": "type mismatch", "module_type": "binary"}]} diff --git a/internal/integration_test/spectest/v2/testdata/table_grow.wast b/internal/integration_test/spectest/v2/testdata/table_grow.wast index 7d5b5630..9a931a7f 100644 --- a/internal/integration_test/spectest/v2/testdata/table_grow.wast +++ b/internal/integration_test/spectest/v2/testdata/table_grow.wast @@ -7,6 +7,9 @@ (func (export "grow") (param $sz i32) (param $init externref) (result i32) (table.grow $t (local.get $init) (local.get $sz)) ) + (func (export "grow-abbrev") (param $sz i32) (param $init externref) (result i32) + (table.grow (local.get $init) (local.get $sz)) + ) (func (export "size") (result i32) (table.size $t)) ) @@ -22,7 +25,7 @@ (assert_trap (invoke "set" (i32.const 1) (ref.extern 2)) "out of bounds table access") (assert_trap (invoke "get" (i32.const 1)) "out of bounds table access") -(assert_return (invoke "grow" (i32.const 4) (ref.extern 3)) (i32.const 1)) +(assert_return (invoke "grow-abbrev" (i32.const 4) (ref.extern 3)) (i32.const 1)) (assert_return (invoke "size") (i32.const 5)) (assert_return (invoke "get" (i32.const 0)) (ref.extern 2)) (assert_return (invoke "set" (i32.const 0) (ref.extern 2))) diff --git a/internal/integration_test/spectest/v2/testdata/table_set.wast b/internal/integration_test/spectest/v2/testdata/table_set.wast index 5a9cfa37..3362f956 100644 --- a/internal/integration_test/spectest/v2/testdata/table_set.wast +++ b/internal/integration_test/spectest/v2/testdata/table_set.wast @@ -12,7 +12,7 @@ ) (func (export "set-externref") (param $i i32) (param $r externref) - (table.set $t2 (local.get $i) (local.get $r)) + (table.set (local.get $i) (local.get $r)) ) (func (export "set-funcref") (param $i i32) (param $r funcref) (table.set $t3 (local.get $i) (local.get $r)) diff --git a/internal/integration_test/spectest/v2/testdata/table_size.wast b/internal/integration_test/spectest/v2/testdata/table_size.wast index ad293b5e..83fef02b 100644 --- a/internal/integration_test/spectest/v2/testdata/table_size.wast +++ b/internal/integration_test/spectest/v2/testdata/table_size.wast @@ -4,7 +4,7 @@ (table $t2 0 2 externref) (table $t3 3 8 externref) - (func (export "size-t0") (result i32) (table.size $t0)) + (func (export "size-t0") (result i32) table.size) (func (export "size-t1") (result i32) (table.size $t1)) (func (export "size-t2") (result i32) (table.size $t2)) (func (export "size-t3") (result i32) (table.size $t3)) diff --git a/internal/wasm/binary/element.go b/internal/wasm/binary/element.go index a969fcc5..538b9834 100644 --- a/internal/wasm/binary/element.go +++ b/internal/wasm/binary/element.go @@ -33,6 +33,10 @@ func decodeElementInitValueVector(r *bytes.Reader) ([]wasm.Index, error) { if err != nil { return nil, fmt.Errorf("read function index: %w", err) } + + if u32 >= wasm.MaximumFunctionIndex { + return nil, fmt.Errorf("too large function index in Element init: %d", u32) + } vec[i] = u32 } return vec, nil @@ -56,6 +60,9 @@ func decodeElementConstExprVector(r *bytes.Reader, elemType wasm.RefType, enable return nil, fmt.Errorf("element type mismatch: want %s, but constexpr has funcref", wasm.RefTypeName(elemType)) } v, _, _ := leb128.LoadUint32(expr.Data) + if v >= wasm.MaximumFunctionIndex { + return nil, fmt.Errorf("too large function index in Element init: %d", v) + } vec[i] = v case wasm.OpcodeRefNull: if elemType != expr.Data[0] { @@ -63,6 +70,14 @@ func decodeElementConstExprVector(r *bytes.Reader, elemType wasm.RefType, enable wasm.RefTypeName(elemType), wasm.RefTypeName(expr.Data[0])) } vec[i] = wasm.ElementInitNullReference + case wasm.OpcodeGlobalGet: + i32, _, _ := leb128.LoadInt32(expr.Data) + if elemType != wasm.RefTypeFuncref { + return nil, fmt.Errorf("element type mismatch: want %s, but requires funcref", wasm.RefTypeName(elemType)) + } + // Resolving the function index is done at instantiation phase. See the comment on + // wasm.ElementInitImportedGlobalFunctionReference. + vec[i] = wasm.ElementInitImportedGlobalFunctionReference | wasm.Index(i32) default: return nil, fmt.Errorf("const expr must be either ref.null or ref.func but was %s", wasm.InstructionName(expr.Opcode)) } diff --git a/internal/wasm/binary/element_test.go b/internal/wasm/binary/element_test.go index 8eff438b..eefa7d12 100644 --- a/internal/wasm/binary/element_test.go +++ b/internal/wasm/binary/element_test.go @@ -17,8 +17,9 @@ func Test_ensureElementKindFuncRef(t *testing.T) { func Test_decodeElementInitValueVector(t *testing.T) { tests := []struct { - in []byte - exp []wasm.Index + in []byte + exp []wasm.Index + expErr string }{ { in: []byte{0}, @@ -28,14 +29,25 @@ func Test_decodeElementInitValueVector(t *testing.T) { in: []byte{5, 1, 2, 3, 4, 5}, exp: []wasm.Index{1, 2, 3, 4, 5}, }, + { + in: []byte{ + 1, + 0xff, 0xff, 0xff, 0xff, 0xf, + }, + expErr: "too large function index in Element init: 4294967295", + }, } for i, tt := range tests { tc := tt t.Run(strconv.Itoa(i), func(t *testing.T) { actual, err := decodeElementInitValueVector(bytes.NewReader(tc.in)) - require.NoError(t, err) - require.Equal(t, tc.exp, actual) + if tc.expErr != "" { + require.EqualError(t, err, tc.expErr) + } else { + require.NoError(t, err) + require.Equal(t, tc.exp, actual) + } }) } } @@ -65,14 +77,20 @@ func Test_decodeElementConstExprVector(t *testing.T) { }, { in: []byte{ - 3, // Three indexes. + 4, // Three indexes. wasm.OpcodeRefNull, wasm.RefTypeFuncref, wasm.OpcodeEnd, wasm.OpcodeRefFunc, - 0x80, 0x80, 0x80, 0x4f, // 165675008 in varint encoding. + 0x80, 0x7f, wasm.OpcodeEnd, + wasm.OpcodeGlobalGet, 1, wasm.OpcodeEnd, wasm.OpcodeRefNull, wasm.RefTypeFuncref, wasm.OpcodeEnd, }, - exp: []wasm.Index{wasm.ElementInitNullReference, 165675008, wasm.ElementInitNullReference}, + exp: []wasm.Index{ + wasm.ElementInitNullReference, + 16256, + wasm.ElementInitImportedGlobalFunctionReference | 1, + wasm.ElementInitNullReference, + }, refType: wasm.RefTypeFuncref, features: api.CoreFeatureBulkMemoryOperations, }, @@ -143,6 +161,20 @@ func Test_decodeElementConstExprVector_errors(t *testing.T) { features: api.CoreFeaturesV2, expErr: "element type mismatch: want externref, but constexpr has funcref", }, + { + name: "too large index - ref.fuc", + in: []byte{1, wasm.OpcodeRefFunc, 0xff, 0xff, 0xff, 0xff, 0xf, wasm.OpcodeEnd}, + refType: wasm.RefTypeFuncref, + features: api.CoreFeaturesV2, + expErr: "too large function index in Element init: 4294967295", + }, + { + name: "type mismatch - global.get", + in: []byte{1, wasm.OpcodeGlobalGet, 0, wasm.OpcodeEnd}, + refType: wasm.RefTypeExternref, + features: api.CoreFeaturesV2, + expErr: "element type mismatch: want externref, but requires funcref", + }, } for _, tt := range tests { @@ -289,13 +321,13 @@ func TestDecodeElementSegment(t *testing.T) { 3, // number of const expr. wasm.OpcodeRefNull, wasm.RefTypeFuncref, wasm.OpcodeEnd, wasm.OpcodeRefFunc, - 0x80, 0x80, 0x80, 0x4f, // 165675008 in varint encoding. + 0x80, 0x7f, wasm.OpcodeEnd, wasm.OpcodeRefNull, wasm.RefTypeFuncref, wasm.OpcodeEnd, }, exp: wasm.ElementSegment{ OffsetExpr: wasm.ConstantExpression{Opcode: wasm.OpcodeI32Const, Data: []byte{0x80, 1}}, - Init: []wasm.Index{wasm.ElementInitNullReference, 165675008, wasm.ElementInitNullReference}, + Init: []wasm.Index{wasm.ElementInitNullReference, 16256, wasm.ElementInitNullReference}, Mode: wasm.ElementModeActive, Type: wasm.RefTypeFuncref, }, @@ -310,12 +342,12 @@ func TestDecodeElementSegment(t *testing.T) { 3, // number of const expr. wasm.OpcodeRefNull, wasm.RefTypeFuncref, wasm.OpcodeEnd, wasm.OpcodeRefFunc, - 0x80, 0x80, 0x80, 0x4f, // 165675008 in varint encoding. + 0x80, 0x7f, wasm.OpcodeEnd, wasm.OpcodeRefNull, wasm.RefTypeFuncref, wasm.OpcodeEnd, }, exp: wasm.ElementSegment{ - Init: []wasm.Index{wasm.ElementInitNullReference, 165675008, wasm.ElementInitNullReference}, + Init: []wasm.Index{wasm.ElementInitNullReference, 16256, wasm.ElementInitNullReference}, Mode: wasm.ElementModePassive, Type: wasm.RefTypeFuncref, }, @@ -342,13 +374,13 @@ func TestDecodeElementSegment(t *testing.T) { 3, // number of const expr. wasm.OpcodeRefNull, wasm.RefTypeFuncref, wasm.OpcodeEnd, wasm.OpcodeRefFunc, - 0x80, 0x80, 0x80, 0x4f, // 165675008 in varint encoding. + 0x80, 0x7f, wasm.OpcodeEnd, wasm.OpcodeRefNull, wasm.RefTypeFuncref, wasm.OpcodeEnd, }, exp: wasm.ElementSegment{ OffsetExpr: wasm.ConstantExpression{Opcode: wasm.OpcodeI32Const, Data: []byte{0x80, 1}}, - Init: []wasm.Index{wasm.ElementInitNullReference, 165675008, wasm.ElementInitNullReference}, + Init: []wasm.Index{wasm.ElementInitNullReference, 16256, wasm.ElementInitNullReference}, Mode: wasm.ElementModeActive, Type: wasm.RefTypeFuncref, }, @@ -366,13 +398,13 @@ func TestDecodeElementSegment(t *testing.T) { 3, // number of const expr. wasm.OpcodeRefNull, wasm.RefTypeFuncref, wasm.OpcodeEnd, wasm.OpcodeRefFunc, - 0x80, 0x80, 0x80, 0x4f, // 165675008 in varint encoding. + 0x80, 0x7f, wasm.OpcodeEnd, wasm.OpcodeRefNull, wasm.RefTypeFuncref, wasm.OpcodeEnd, }, exp: wasm.ElementSegment{ OffsetExpr: wasm.ConstantExpression{Opcode: wasm.OpcodeI32Const, Data: []byte{0x80, 1}}, - Init: []wasm.Index{wasm.ElementInitNullReference, 165675008, wasm.ElementInitNullReference}, + Init: []wasm.Index{wasm.ElementInitNullReference, 16256, wasm.ElementInitNullReference}, Mode: wasm.ElementModeActive, Type: wasm.RefTypeFuncref, TableIndex: 10, @@ -407,11 +439,11 @@ func TestDecodeElementSegment(t *testing.T) { 2, // number of const expr. wasm.OpcodeRefNull, wasm.RefTypeFuncref, wasm.OpcodeEnd, wasm.OpcodeRefFunc, - 0x80, 0x80, 0x80, 0x4f, // 165675008 in varint encoding. + 0x80, 0x7f, wasm.OpcodeEnd, }, exp: wasm.ElementSegment{ - Init: []wasm.Index{wasm.ElementInitNullReference, 165675008}, + Init: []wasm.Index{wasm.ElementInitNullReference, 16256}, Mode: wasm.ElementModeDeclarative, Type: wasm.RefTypeFuncref, }, diff --git a/internal/wasm/store.go b/internal/wasm/store.go index 5c40b805..70af5e6f 100644 --- a/internal/wasm/store.go +++ b/internal/wasm/store.go @@ -213,10 +213,19 @@ func (m *ModuleInstance) applyElements(elems []ElementSegment) { references[offset+uint32(i)] = Reference(0) } } else { - for i, fnIndex := range elem.Init { - if fnIndex != ElementInitNullReference { - references[offset+uint32(i)] = m.Engine.FunctionInstanceReference(fnIndex) + for i, init := range elem.Init { + if init == ElementInitNullReference { + continue } + + var ref Reference + if index, ok := unwrapElementInitGlobalReference(init); ok { + global := m.Globals[index] + ref = Reference(global.Val) + } else { + ref = m.Engine.FunctionInstanceReference(index) + } + references[offset+uint32(i)] = ref } } } diff --git a/internal/wasm/store_test.go b/internal/wasm/store_test.go index 383757af..cabe9cc7 100644 --- a/internal/wasm/store_test.go +++ b/internal/wasm/store_test.go @@ -933,7 +933,7 @@ func globalsContain(globals []*GlobalInstance, want *GlobalInstance) bool { return false } -func TestModuleInstance_applyElementsapplyElements(t *testing.T) { +func TestModuleInstance_applyElements(t *testing.T) { leb128_100 := leb128.EncodeInt32(100) t.Run("extenref", func(t *testing.T) { @@ -962,7 +962,7 @@ func TestModuleInstance_applyElementsapplyElements(t *testing.T) { me, err := e.NewModuleEngine(nil, nil) me.(*mockModuleEngine).functionRefs = map[Index]Reference{0: 0xa, 1: 0xaa, 2: 0xaaa, 3: 0xaaaa} require.NoError(t, err) - m := &ModuleInstance{Engine: me} + m := &ModuleInstance{Engine: me, Globals: []*GlobalInstance{{}, {Val: 0xabcde}}} m.Tables = []*TableInstance{{Type: RefTypeFuncref, References: make([]Reference, 10)}} for i := range m.Tables[0].References { @@ -973,15 +973,16 @@ func TestModuleInstance_applyElementsapplyElements(t *testing.T) { m.applyElements([]ElementSegment{{Mode: ElementModeActive, OffsetExpr: ConstantExpression{Opcode: OpcodeI32Const, Data: leb128_100}, Init: []Index{1, 2, 3}}}) m.applyElements([]ElementSegment{ {Mode: ElementModeActive, OffsetExpr: ConstantExpression{Opcode: OpcodeI32Const, Data: []byte{0}}, Init: []Index{0, 1, 2}}, + {Mode: ElementModeActive, OffsetExpr: ConstantExpression{Opcode: OpcodeI32Const, Data: []byte{9}}, Init: []Index{1 | ElementInitImportedGlobalFunctionReference}}, {Mode: ElementModeActive, OffsetExpr: ConstantExpression{Opcode: OpcodeI32Const, Data: leb128_100}, Init: make([]Index, 5)}, // Iteration stops at this point, so the offset:5 below shouldn't be applied. {Mode: ElementModeActive, OffsetExpr: ConstantExpression{Opcode: OpcodeI32Const, Data: []byte{5}}, Init: make([]Index, 5)}, }) - require.Equal(t, []Reference{0xa, 0xaa, 0xaaa, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}, + require.Equal(t, []Reference{0xa, 0xaa, 0xaaa, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xabcde}, m.Tables[0].References) m.applyElements([]ElementSegment{ {Mode: ElementModeActive, OffsetExpr: ConstantExpression{Opcode: OpcodeI32Const, Data: []byte{5}}, Init: []Index{0, ElementInitNullReference, 2}}, }) - require.Equal(t, []Reference{0xa, 0xaa, 0xaaa, 0xffff, 0xffff, 0xa, 0xffff, 0xaaa, 0xffff, 0xffff}, + require.Equal(t, []Reference{0xa, 0xaa, 0xaaa, 0xffff, 0xffff, 0xa, 0xffff, 0xaaa, 0xffff, 0xabcde}, m.Tables[0].References) }) } diff --git a/internal/wasm/table.go b/internal/wasm/table.go index cd20fec0..b202e8af 100644 --- a/internal/wasm/table.go +++ b/internal/wasm/table.go @@ -76,12 +76,32 @@ type ElementSegment struct { Mode ElementMode } -// ElementInitNullReference represents the null reference in ElementSegment's Init. -// In Wasm spec, an init item represents either Function's Index or null reference, -// and in wazero, we limit the maximum number of functions available in a module to -// MaximumFunctionIndex. Therefore, it is safe to use math.MaxUint32 to represent the null -// reference in Element segments. -const ElementInitNullReference Index = math.MaxUint32 +const ( + // ElementInitNullReference represents the null reference in ElementSegment's Init. + // In Wasm spec, an init item represents either Function's Index or null reference, + // and in wazero, we limit the maximum number of functions available in a module to + // MaximumFunctionIndex. Therefore, it is safe to use 1 << 31 to represent the null + // reference in Element segments. + ElementInitNullReference Index = 1 << 31 + // ElementInitImportedGlobalFunctionReference represents an init item which is resolved via an imported global constexpr. + // The actual function reference stored at Global is only known at instantiation-time, so we set this flag + // to items of ElementSegment.Init at binary decoding, and unwrap this flag at instantiation to resolve the value. + // + // This might collide the init element resolved via ref.func instruction which is resolved with the func index at decoding, + // but in practice, that is not allowed in wazero thanks to our limit MaximumFunctionIndex. Thus, it is safe to set this flag + // in init element to indicate as such. + ElementInitImportedGlobalFunctionReference Index = 1 << 30 +) + +// unwrapElementInitGlobalReference takes an item of the init vector of an ElementSegment, +// and returns the Global index if it is supposed to get generated from a global. +// ok is true if the given init item is as such. +func unwrapElementInitGlobalReference(init Index) (_ Index, ok bool) { + if init&ElementInitImportedGlobalFunctionReference == ElementInitImportedGlobalFunctionReference { + return init &^ ElementInitImportedGlobalFunctionReference, true + } + return init, false +} // IsActive returns true if the element segment is "active" mode which requires the runtime to initialize table // with the contents in .Init field. @@ -135,6 +155,7 @@ func (m *Module) validateTable(enabledFeatures api.CoreFeatures, tables []Table, // Create bounds checks as these can err prior to instantiation funcCount := m.ImportFunctionCount + m.SectionElementCount(SectionIDFunction) + globalsCount := m.ImportGlobalCount + m.SectionElementCount(SectionIDGlobal) // Now, we have to figure out which table elements can be resolved before instantiation and also fail early if there // are any imported globals that are known to be invalid by their declarations. @@ -145,9 +166,19 @@ func (m *Module) validateTable(enabledFeatures api.CoreFeatures, tables []Table, if elem.Type == RefTypeFuncref { // Any offset applied is to the element, not the function index: validate here if the funcidx is sound. - for ei, funcIdx := range elem.Init { - if funcIdx != ElementInitNullReference && funcIdx >= funcCount { - return fmt.Errorf("%s[%d].init[%d] funcidx %d out of range", SectionIDName(SectionIDElement), idx, ei, funcIdx) + for ei, init := range elem.Init { + if init == ElementInitNullReference { + continue + } + index, ok := unwrapElementInitGlobalReference(init) + if ok { + if index >= globalsCount { + return fmt.Errorf("%s[%d].init[%d] globalidx %d out of range", SectionIDName(SectionIDElement), idx, ei, index) + } + } else { + if index >= funcCount { + return fmt.Errorf("%s[%d].init[%d] funcidx %d out of range", SectionIDName(SectionIDElement), idx, ei, index) + } } } } else { diff --git a/internal/wasm/table_test.go b/internal/wasm/table_test.go index 5d343a32..1c5b2559 100644 --- a/internal/wasm/table_test.go +++ b/internal/wasm/table_test.go @@ -528,6 +528,26 @@ func TestModule_validateTable_Errors(t *testing.T) { }, expectedErr: "element[0].init[1] funcidx 1 out of range", }, + { + name: "constant derived element offset - global out of range", + input: &Module{ + ImportGlobalCount: 50, + TypeSection: []FunctionType{{}}, + TableSection: []Table{{Min: 1}}, + FunctionSection: []Index{0}, + CodeSection: []Code{codeEnd}, + ElementSection: []ElementSegment{ + { + OffsetExpr: ConstantExpression{Opcode: OpcodeI32Const, Data: const1}, Init: []Index{ + ElementInitImportedGlobalFunctionReference | 1, + ElementInitImportedGlobalFunctionReference | 100, + }, + Type: RefTypeFuncref, + }, + }, + }, + expectedErr: "element[0].init[1] globalidx 100 out of range", + }, { name: "imported global derived element offset - missing table", input: &Module{ @@ -1052,3 +1072,20 @@ func TestTableInstance_Grow(t *testing.T) { }) } } + +func Test_unwrapElementInitGlobalReference(t *testing.T) { + actual, ok := unwrapElementInitGlobalReference(12345 | ElementInitImportedGlobalFunctionReference) + require.True(t, ok) + require.Equal(t, actual, uint32(12345)) + + actual, ok = unwrapElementInitGlobalReference(12345) + require.False(t, ok) + require.Equal(t, actual, uint32(12345)) +} + +// Test_ElementInitSpecials ensures these special consts are larger than MaximumFunctionIndex so that +// they won't collide with the actual index. +func Test_ElementInitSpecials(t *testing.T) { + require.True(t, ElementInitNullReference > MaximumFunctionIndex) + require.True(t, ElementInitImportedGlobalFunctionReference > MaximumFunctionIndex) +}