Skip to content

Commit

Permalink
[1.6>1.7] [MERGE #3491 @Cellule] WASM - binary version 0xd
Browse files Browse the repository at this point in the history
Merge pull request #3491 from Cellule:users/micfer/wasm/version

Stop supporting WebAssembly binary version 0x0d.
We've been supporting the binary version for a while to help minize potential testing infrastructure problems.
At this time I think we've switched to version 0x1 for long enough and we don't want to offically support version 0xd in the next release
  • Loading branch information
Cellule committed Aug 9, 2017
2 parents e0141fb + f7af90e commit 992b1d7
Show file tree
Hide file tree
Showing 31 changed files with 17 additions and 23 deletions.
7 changes: 1 addition & 6 deletions lib/WasmReader/WasmBinaryReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,12 +469,7 @@ void WasmBinaryReader::ValidateModuleHeader()

if (CONFIG_FLAG(WasmCheckVersion))
{
// Accept version 0xd to avoid problem in our test infrastructure
// We should eventually remove support for 0xd.
// The Assert is here as a reminder in case we change the binary version and we haven't removed 0xd support yet
CompileAssert(binaryVersion == 0x1);

if (version != binaryVersion && version != 0xd)
if (version != binaryVersion)
{
ThrowDecodingError(_u("Invalid WASM version!"));
}
Expand Down
3 changes: 1 addition & 2 deletions test/WasmSpec/baselines/binary.baseline
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
(28) testsuite/core/binary.wast:40: assert_malformed module failed. Had a linking error, expected a compile error: TypeError: Object expected
31/32 tests passed.
32/32 tests passed.
8 changes: 4 additions & 4 deletions test/wasm/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const invalidBuffers = [
{length: 15},
function() {},
new ArrayBuffer(),
createView("\x00\x61\x73\x6d\x0d\x00\x00\x00\x01\x85\x80\x80"),
createView("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80"),
new Proxy(buf, {get(target, name) {return target[name];}}),
];

Expand Down Expand Up @@ -218,7 +218,7 @@ async function testModuleCustomSection(baseModule) {
}

// See wasts/custom_section.wast for reference
const module1 = new WebAssembly.Module(createView("\x00\x61\x73\x6d\x0d\x00\x00\x00\x00\x24\x10\x61\x20\x63\x75\x73\x74\x6f\x6d\x20\x73\x65\x63\x74\x69\x6f\x6e\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x70\x61\x79\x6c\x6f\x61\x64\x00\x20\x10\x61\x20\x63\x75\x73\x74\x6f\x6d\x20\x73\x65\x63\x74\x69\x6f\x6e\x74\x68\x69\x73\x20\x69\x73\x20\x70\x61\x79\x6c\x6f\x61\x64\x00\x11\x10\x61\x20\x63\x75\x73\x74\x6f\x6d\x20\x73\x65\x63\x74\x69\x6f\x6e\x00\x10\x00\x74\x68\x69\x73\x20\x69\x73\x20\x70\x61\x79\x6c\x6f\x61\x64\x00\x01\x00\x00\x24\x10\x00\x00\x63\x75\x73\x74\x6f\x6d\x20\x73\x65\x63\x74\x69\x6f\x00\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x70\x61\x79\x6c\x6f\x61\x64"));
const module1 = new WebAssembly.Module(createView("\x00\x61\x73\x6d\x01\x00\x00\x00\x00\x24\x10\x61\x20\x63\x75\x73\x74\x6f\x6d\x20\x73\x65\x63\x74\x69\x6f\x6e\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x70\x61\x79\x6c\x6f\x61\x64\x00\x20\x10\x61\x20\x63\x75\x73\x74\x6f\x6d\x20\x73\x65\x63\x74\x69\x6f\x6e\x74\x68\x69\x73\x20\x69\x73\x20\x70\x61\x79\x6c\x6f\x61\x64\x00\x11\x10\x61\x20\x63\x75\x73\x74\x6f\x6d\x20\x73\x65\x63\x74\x69\x6f\x6e\x00\x10\x00\x74\x68\x69\x73\x20\x69\x73\x20\x70\x61\x79\x6c\x6f\x61\x64\x00\x01\x00\x00\x24\x10\x00\x00\x63\x75\x73\x74\x6f\x6d\x20\x73\x65\x63\x74\x69\x6f\x00\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x70\x61\x79\x6c\x6f\x61\x64"));
compare(module1, "a custom section", [
"this is the payload",
"this is payload",
Expand All @@ -231,11 +231,11 @@ async function testModuleCustomSection(baseModule) {
compare(module1, "\00\00custom sectio\00", [
"this is the payload",
]);
const module2 = new WebAssembly.Module(createView("\x00\x61\x73\x6d\x0d\x00\x00\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x01\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x02\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x03\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x04\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x05\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x06\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x07\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x09\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x0a\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x0b\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64"));
const module2 = new WebAssembly.Module(createView("\x00\x61\x73\x6d\x01\x00\x00\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x01\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x02\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x03\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x04\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x05\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x06\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x07\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x09\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x0a\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x0b\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64"));
compare(module2, "custom", new Proxy({length: 22}, {
get: (target, name) => name in target ? target[name] : "payload"
}));
const module3 = new WebAssembly.Module(createView("\x00\x61\x73\x6d\x0d\x00\x00\x00\x01\x07\x01\x60\x02\x7f\x7f\x01\x7f\x00\x1a\x06\x63\x75\x73\x74\x6f\x6d\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x70\x61\x79\x6c\x6f\x61\x64\x03\x02\x01\x00\x07\x0a\x01\x06\x61\x64\x64\x54\x77\x6f\x00\x00\x0a\x09\x01\x07\x00\x20\x00\x20\x01\x6a\x0b\x00\x1b\x07\x63\x75\x73\x74\x6f\x6d\x32\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x70\x61\x79\x6c\x6f\x61\x64"));
const module3 = new WebAssembly.Module(createView("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x07\x01\x60\x02\x7f\x7f\x01\x7f\x00\x1a\x06\x63\x75\x73\x74\x6f\x6d\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x70\x61\x79\x6c\x6f\x61\x64\x03\x02\x01\x00\x07\x0a\x01\x06\x61\x64\x64\x54\x77\x6f\x00\x00\x0a\x09\x01\x07\x00\x20\x00\x20\x01\x6a\x0b\x00\x1b\x07\x63\x75\x73\x74\x6f\x6d\x32\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x70\x61\x79\x6c\x6f\x61\x64"));
compare(module3, "custom", ["this is the payload"]);
compare(module3, "custom2", ["this is the payload"]);
console.log(`${passed}/${passed + failed} tests passed`);
Expand Down
Binary file modified test/wasm/array.wasm
Binary file not shown.
Binary file modified test/wasm/basic.wasm
Binary file not shown.
Binary file modified test/wasm/binaries/api.wasm
Binary file not shown.
Binary file modified test/wasm/binaries/bugDeferred.wasm
Binary file not shown.
Binary file modified test/wasm/binaries/bug_fitsdword.wasm
Binary file not shown.
Binary file modified test/wasm/binaries/call.0.wasm
Binary file not shown.
Binary file modified test/wasm/binaries/call.1.wasm
Binary file not shown.
Binary file modified test/wasm/binaries/fastarray.wasm
Binary file not shown.
Binary file modified test/wasm/binaries/global.wasm
Binary file not shown.
Binary file modified test/wasm/binaries/i64_invalid_global_export.wasm
Binary file not shown.
Binary file modified test/wasm/binaries/i64_invalid_global_import.wasm
Binary file not shown.
Binary file modified test/wasm/binaries/invalid_global_init.wasm
Binary file not shown.
Binary file modified test/wasm/binaries/table_imports.wasm
Binary file not shown.
Binary file modified test/wasm/controlflow.wasm
Binary file not shown.
Binary file modified test/wasm/debugger.wasm
Binary file not shown.
Binary file modified test/wasm/dropteelocal.wasm
Binary file not shown.
Binary file modified test/wasm/f32address.wasm
Binary file not shown.
Binary file modified test/wasm/i32_popcnt.wasm
Binary file not shown.
Binary file modified test/wasm/i64cf.wasm
Binary file not shown.
8 changes: 4 additions & 4 deletions test/wasm/invalid_global_mut.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ function assert_return_nan(action) {
};
}

assert_malformed("\x00\x61\x73\x6d\x0d\x00\x00\x00\x02\x94\x80\x80\x80\x00\x01\x08\x73\x70\x65\x63\x74\x65\x73\x74\x06\x67\x6c\x6f\x62\x61\x6c\x03\x7f\x02");
assert_malformed("\x00\x61\x73\x6d\x0d\x00\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\xff\x41\x00\x0b");
assert_malformed("\x00\x61\x73\x6d\x0d\x00\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\xd4\x41\x00\x0b");
assert_malformed("\x00\x61\x73\x6d\x0d\x00\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\x02\x41\x00\x0b");
assert_malformed("\x00\x61\x73\x6d\x01\x00\x00\x00\x02\x94\x80\x80\x80\x00\x01\x08\x73\x70\x65\x63\x74\x65\x73\x74\x06\x67\x6c\x6f\x62\x61\x6c\x03\x7f\x02");
assert_malformed("\x00\x61\x73\x6d\x01\x00\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\xff\x41\x00\x0b");
assert_malformed("\x00\x61\x73\x6d\x01\x00\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\xd4\x41\x00\x0b");
assert_malformed("\x00\x61\x73\x6d\x01\x00\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\x02\x41\x00\x0b");
print("PASSED");
Binary file modified test/wasm/math.wasm
Binary file not shown.
Binary file modified test/wasm/misc.wasm
Binary file not shown.
Binary file modified test/wasm/oom.wasm
Binary file not shown.
Binary file modified test/wasm/rot.wasm
Binary file not shown.
Binary file modified test/wasm/table.wasm
Binary file not shown.
Binary file modified test/wasm/trunc.wasm
Binary file not shown.
6 changes: 3 additions & 3 deletions test/wasm/wasts/custom_section.wast
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
;; Reference: https://github.com/WebAssembly/spec/blob/master/interpreter/test/custom_section.wast
;; See ..\..\WasmSpec\testsuite\LICENSE for license details
(module
"\00asm" "\0d\00\00\00"
"\00asm" "\01\00\00\00"
"\00\24\10" "a custom section" "this is the payload"
"\00\20\10" "a custom section" "this is payload"
"\00\11\10" "a custom section" ""
Expand All @@ -16,7 +16,7 @@
)

(module
"\00asm" "\0d\00\00\00"
"\00asm" "\01\00\00\00"
"\00\0e\06" "custom" "payload"
"\00\0e\06" "custom" "payload"
"\01\01\00" ;; type section
Expand Down Expand Up @@ -52,7 +52,7 @@
)

(module
"\00asm" "\0d\00\00\00"
"\00asm" "\01\00\00\00"
"\01\07\01\60\02\7f\7f\01\7f" ;; type section
"\00\1a\06" "custom" "this is the payload" ;; custom section
"\03\02\01\00" ;; function section
Expand Down
8 changes: 4 additions & 4 deletions test/wasm/wasts/invalid_global_mut.wast
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
;;(module
;; (import "spectest" "global" (global i32))
;;)
(assert_malformed (module "\00asm\0d\00\00\00\02\94\80\80\80\00\01\08\73\70\65\63\74\65\73\74\06\67\6c\6f\62\61\6c\03\7f\02") "invalid mutability")
(assert_malformed (module "\00asm\01\00\00\00\02\94\80\80\80\00\01\08\73\70\65\63\74\65\73\74\06\67\6c\6f\62\61\6c\03\7f\02") "invalid mutability")

;;(module
;; (global i32 (i32.const 0))
;;)
(assert_malformed (module "\00asm\0d\00\00\00\06\86\80\80\80\00\01\7f\ff\41\00\0b") "invalid mutability")
(assert_malformed (module "\00asm\0d\00\00\00\06\86\80\80\80\00\01\7f\d4\41\00\0b") "invalid mutability")
(assert_malformed (module "\00asm\0d\00\00\00\06\86\80\80\80\00\01\7f\02\41\00\0b") "invalid mutability")
(assert_malformed (module "\00asm\01\00\00\00\06\86\80\80\80\00\01\7f\ff\41\00\0b") "invalid mutability")
(assert_malformed (module "\00asm\01\00\00\00\06\86\80\80\80\00\01\7f\d4\41\00\0b") "invalid mutability")
(assert_malformed (module "\00asm\01\00\00\00\06\86\80\80\80\00\01\7f\02\41\00\0b") "invalid mutability")

0 comments on commit 992b1d7

Please sign in to comment.