diff --git a/implementation-contributed/curation_logs/javascriptcore.json b/implementation-contributed/curation_logs/javascriptcore.json index 7e1e764236a028c221fe1de356f540e366dd47e8..10b448f922c083257681c431a6d46d33cf69c96b 100644 --- a/implementation-contributed/curation_logs/javascriptcore.json +++ b/implementation-contributed/curation_logs/javascriptcore.json @@ -1,6 +1,6 @@ { - "sourceRevisionAtLastExport": "8a25978f29", - "targetRevisionAtLastExport": "70dc33467", + "sourceRevisionAtLastExport": "671be37db3", + "targetRevisionAtLastExport": "eaa48b4f0", "curatedFiles": { "/stress/Number-isNaN-basics.js": "DELETED_IN_TARGET", "/stress/Object_static_methods_Object.getOwnPropertyDescriptors-proxy.js": "DELETED_IN_TARGET", diff --git a/implementation-contributed/javascriptcore/stress/regress-188577.js b/implementation-contributed/javascriptcore/stress/regress-188577.js new file mode 100644 index 0000000000000000000000000000000000000000..46b87511b0922aaa6bc84d6330f0c75fee42c35e --- /dev/null +++ b/implementation-contributed/javascriptcore/stress/regress-188577.js @@ -0,0 +1,20 @@ +//@ requireOptions("--maxPerThreadStackUsage=262144") + +var exception; +try { + var i = 25000; + var args = []; + var v3; + while (i--) + args[i] = "a"; + var argsList = args.join(); + setter = Function(argsList, ""); + Object.defineProperty(args, '0', {set: setter}); + args.sort(); + +} catch (e) { + exception = e; +} + +if (exception != "RangeError: Maximum call stack size exceeded.") + throw "FAILED"; diff --git a/implementation-contributed/javascriptcore/wasm/function-tests/invalid-duplicate-export.js b/implementation-contributed/javascriptcore/wasm/function-tests/invalid-duplicate-export.js index c47b1e1662c2cb60c93d6c9b95739bdaba780e73..418d51aa499019aa2469baa5f1fd8e1abd3bf291 100644 --- a/implementation-contributed/javascriptcore/wasm/function-tests/invalid-duplicate-export.js +++ b/implementation-contributed/javascriptcore/wasm/function-tests/invalid-duplicate-export.js @@ -15,5 +15,5 @@ import * as assert from '../assert.js'; .End(); const bin = builder.WebAssembly().get(); - assert.throws(() => new WebAssembly.Module(bin), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 31 / 39: duplicate export: 'foo'"); + assert.throws(() => new WebAssembly.Module(bin), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 31: duplicate export: 'foo'"); } diff --git a/implementation-contributed/javascriptcore/wasm/function-tests/memory-alignment.js b/implementation-contributed/javascriptcore/wasm/function-tests/memory-alignment.js index abc57412146f2e397261e7326ecc8a5c819a049c..e605898900aa1bed67b9d32ac6f2aa012eb299ee 100644 --- a/implementation-contributed/javascriptcore/wasm/function-tests/memory-alignment.js +++ b/implementation-contributed/javascriptcore/wasm/function-tests/memory-alignment.js @@ -42,7 +42,7 @@ for (const op of WASM.opcodes("memory")) { if (alignLog2 <= maxAlignLog2) instance(); else - assert.throws(instance, WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte ${start} / ${end}: byte alignment ${1 << alignLog2} exceeds ${info.type}'s natural alignment ${1 << maxAlignLog2}, in function at index 0`); + assert.throws(instance, WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte ${start}: byte alignment ${1 << alignLog2} exceeds ${info.type}'s natural alignment ${1 << maxAlignLog2}, in function at index 0`); } } diff --git a/implementation-contributed/javascriptcore/wasm/function-tests/memory-section-and-import.js b/implementation-contributed/javascriptcore/wasm/function-tests/memory-section-and-import.js index a1db9ce25779350b5bd5577f767e667774bd8b0b..15207ef7188efa0f6923573c1dfea5a3ea5b71ff 100644 --- a/implementation-contributed/javascriptcore/wasm/function-tests/memory-section-and-import.js +++ b/implementation-contributed/javascriptcore/wasm/function-tests/memory-section-and-import.js @@ -28,4 +28,4 @@ const builder1 = (new Builder()) .Code().End(); const i0 = instantiate(builder0); -assert.throws(() => instantiate(builder1, { imp: { memory: i0.exports.memory } }), WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte 35 / 41: there can at most be one Memory section for now`); +assert.throws(() => instantiate(builder1, { imp: { memory: i0.exports.memory } }), WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte 35: there can at most be one Memory section for now`); diff --git a/implementation-contributed/javascriptcore/wasm/function-tests/void-argument-type-should-be-a-validation-error.js b/implementation-contributed/javascriptcore/wasm/function-tests/void-argument-type-should-be-a-validation-error.js index 47149b1d7fb93231c25d078a86298b7502bff68a..2178810a7817d97335e62f78b3fc517e3fe77e41 100644 --- a/implementation-contributed/javascriptcore/wasm/function-tests/void-argument-type-should-be-a-validation-error.js +++ b/implementation-contributed/javascriptcore/wasm/function-tests/void-argument-type-should-be-a-validation-error.js @@ -17,6 +17,6 @@ function getBinary(params) { return builder.WebAssembly().get(); } -assert.throws(() => new WebAssembly.Module(getBinary(["i32", "void"])), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 15 / 47: can't get 1th argument Type"); -assert.throws(() => new WebAssembly.Module(getBinary(["void"])), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 14 / 46: can't get 0th argument Type"); -assert.throws(() => new WebAssembly.Module(getBinary(["i32", "void", "i32"])), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 15 / 48: can't get 1th argument Type"); +assert.throws(() => new WebAssembly.Module(getBinary(["i32", "void"])), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 15: can't get 1th argument Type"); +assert.throws(() => new WebAssembly.Module(getBinary(["void"])), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 14: can't get 0th argument Type"); +assert.throws(() => new WebAssembly.Module(getBinary(["i32", "void", "i32"])), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 15: can't get 1th argument Type"); diff --git a/implementation-contributed/javascriptcore/wasm/js-api/Module-compile.js b/implementation-contributed/javascriptcore/wasm/js-api/Module-compile.js index d3beb332577aedb058c8e41d23adda9c91f1df78..d723bf4d70b49c49a1365fdc67b45242b38272e6 100644 --- a/implementation-contributed/javascriptcore/wasm/js-api/Module-compile.js +++ b/implementation-contributed/javascriptcore/wasm/js-api/Module-compile.js @@ -21,7 +21,7 @@ async function testPromiseAPI() { await WebAssembly.compile(builder.WebAssembly().get()); } catch(e) { assert.truthy(e instanceof WebAssembly.CompileError); - assert.truthy(e.message === "WebAssembly.Module doesn't parse at byte 34 / 43: there can at most be one Memory section for now"); + assert.truthy(e.message === "WebAssembly.Module doesn't parse at byte 34: there can at most be one Memory section for now"); } } diff --git a/implementation-contributed/javascriptcore/wasm/js-api/element.js b/implementation-contributed/javascriptcore/wasm/js-api/element.js index 188ac74151126048b827248dc4738205aa86a149..fcbe2827f371663aa84fdf5c10100b8178177390 100644 --- a/implementation-contributed/javascriptcore/wasm/js-api/element.js +++ b/implementation-contributed/javascriptcore/wasm/js-api/element.js @@ -18,7 +18,7 @@ import * as assert from '../assert.js'; .End() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 24 / 41: Element section for Table 0 exceeds available Table 0"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 24: Element section for Table 0 exceeds available Table 0"); } { @@ -41,7 +41,7 @@ import * as assert from '../assert.js'; .End() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 30 / 47: Element section for Table 1 exceeds available Table 1"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 30: Element section for Table 1 exceeds available Table 1"); } { @@ -112,7 +112,7 @@ import * as assert from '../assert.js'; .End() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 38 / 50: Element section's 0th element's 2th index is 1 which exceeds the function index space size of 1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 38: Element section's 0th element's 2th index is 1 which exceeds the function index space size of 1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"); } { @@ -215,5 +215,5 @@ import * as assert from '../assert.js'; return new WebAssembly.Module(bin); } - assert.throws(() => badModule(), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 58 / 72: Element init_expr must produce an i32"); + assert.throws(() => badModule(), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 58: Element init_expr must produce an i32"); } diff --git a/implementation-contributed/javascriptcore/wasm/js-api/global-error.js b/implementation-contributed/javascriptcore/wasm/js-api/global-error.js index 09f8d799dc4e2f39d9a54302caabde7a76d5107b..d3edf898e7d9fa07e470cfc32c6ab36f1731b513 100644 --- a/implementation-contributed/javascriptcore/wasm/js-api/global-error.js +++ b/implementation-contributed/javascriptcore/wasm/js-api/global-error.js @@ -23,7 +23,7 @@ import Builder from '../Builder.js'; const bin = builder.WebAssembly(); bin.trim(); - assert.throws(() => new WebAssembly.Module(bin.get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 26 / 59: get_global's index 0 exceeds the number of globals 0 (evaluating 'new WebAssembly.Module(bin.get())')"); + assert.throws(() => new WebAssembly.Module(bin.get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 26: get_global's index 0 exceeds the number of globals 0 (evaluating 'new WebAssembly.Module(bin.get())')"); } @@ -52,7 +52,7 @@ import Builder from '../Builder.js'; const bin = builder.WebAssembly(); bin.trim(); - assert.throws(() => new WebAssembly.Module(bin.get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 32 / 76: Mutable Globals aren't supported (evaluating 'new WebAssembly.Module(bin.get())')"); + assert.throws(() => new WebAssembly.Module(bin.get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 32: Mutable Globals aren't supported (evaluating 'new WebAssembly.Module(bin.get())')"); } { @@ -77,7 +77,7 @@ import Builder from '../Builder.js'; const bin = builder.WebAssembly(); bin.trim(); - assert.throws(() => new WebAssembly.Module(bin.get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 51 / 59: 1th Export isn't immutable, named 'global' (evaluating 'new WebAssembly.Module(bin.get())')"); + assert.throws(() => new WebAssembly.Module(bin.get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 51: 1th Export isn't immutable, named 'global' (evaluating 'new WebAssembly.Module(bin.get())')"); } { diff --git a/implementation-contributed/javascriptcore/wasm/js-api/table.js b/implementation-contributed/javascriptcore/wasm/js-api/table.js index b832e117664130230fc80bfb130c1366a312e325..cf68b440495f6be6f8b27947712456d7ca7c8c6f 100644 --- a/implementation-contributed/javascriptcore/wasm/js-api/table.js +++ b/implementation-contributed/javascriptcore/wasm/js-api/table.js @@ -13,7 +13,7 @@ import * as assert from '../assert.js'; .End() .Code() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 34 / 41: Cannot have more than one Table for now"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 34: Cannot have more than one Table for now"); } { @@ -38,7 +38,7 @@ import * as assert from '../assert.js'; .End() .Code() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 17 / 28: Table count of 2 is invalid, at most 1 is allowed for now (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 17: Table count of 2 is invalid, at most 1 is allowed for now (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"); } { @@ -54,7 +54,7 @@ import * as assert from '../assert.js'; .CallIndirect(0, 0) .End() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 4 / 7: call_indirect is only valid when a table is defined or imported, in function at index 0 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 4: call_indirect is only valid when a table is defined or imported, in function at index 0 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"); } { @@ -73,7 +73,7 @@ import * as assert from '../assert.js'; .CallIndirect(0, 1) .End() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 6 / 7: call_indirect's 'reserved' varuint1 must be 0x0, in function at index 0 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 6: call_indirect's 'reserved' varuint1 must be 0x0, in function at index 0 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"); } { @@ -86,7 +86,7 @@ import * as assert from '../assert.js'; .End() .Code() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 23 / 26: can't export Table 0 there are 0 Tables"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 23: can't export Table 0 there are 0 Tables"); } { @@ -102,7 +102,7 @@ import * as assert from '../assert.js'; .End() .Code() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 30 / 33: can't export Table 1 there are 1 Tables"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 30: can't export Table 1 there are 1 Tables"); } function assertBadTable(tableDescription, message) { @@ -132,42 +132,42 @@ function assertBadTableImport(tableDescription, message) { { let badDescriptions = [ [{initial: 10, element: "i32"}, - "WebAssembly.Module doesn't parse at byte 18 / 23: Table type should be anyfunc, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 26 / 34: Table type should be anyfunc, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 10, element: "f32"}, - "WebAssembly.Module doesn't parse at byte 18 / 23: Table type should be anyfunc, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 26 / 34: Table type should be anyfunc, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 10, element: "f64"}, - "WebAssembly.Module doesn't parse at byte 18 / 23: Table type should be anyfunc, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 26 / 34: Table type should be anyfunc, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 10, element: "i64"}, - "WebAssembly.Module doesn't parse at byte 18 / 23: Table type should be anyfunc, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 26 / 34: Table type should be anyfunc, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 10, maximum: 20, element: "i32"}, - "WebAssembly.Module doesn't parse at byte 18 / 24: Table type should be anyfunc, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 26 / 35: Table type should be anyfunc, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 10, maximum: 20, element: "f32"}, - "WebAssembly.Module doesn't parse at byte 18 / 24: Table type should be anyfunc, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 26 / 35: Table type should be anyfunc, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 10, maximum: 20, element: "f64"}, - "WebAssembly.Module doesn't parse at byte 18 / 24: Table type should be anyfunc, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 26 / 35: Table type should be anyfunc, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 10, maximum: 20, element: "i64"}, - "WebAssembly.Module doesn't parse at byte 18 / 24: Table type should be anyfunc, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 26 / 35: Table type should be anyfunc, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 10, maximum: 9, element: "anyfunc"}, - "WebAssembly.Module doesn't parse at byte 21 / 24: resizable limits has a initial page count of 10 which is greater than its maximum 9 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 29 / 35: resizable limits has a initial page count of 10 which is greater than its maximum 9 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 21: resizable limits has a initial page count of 10 which is greater than its maximum 9 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 29: resizable limits has a initial page count of 10 which is greater than its maximum 9 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 1, maximum: 0, element: "anyfunc"}, - "WebAssembly.Module doesn't parse at byte 21 / 24: resizable limits has a initial page count of 1 which is greater than its maximum 0 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 29 / 35: resizable limits has a initial page count of 1 which is greater than its maximum 0 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 21: resizable limits has a initial page count of 1 which is greater than its maximum 0 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 29: resizable limits has a initial page count of 1 which is greater than its maximum 0 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 2**32 - 1, maximum: 2**32 - 2, element: "anyfunc"}, - "WebAssembly.Module doesn't parse at byte 29 / 32: resizable limits has a initial page count of 4294967295 which is greater than its maximum 4294967294 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 37 / 43: resizable limits has a initial page count of 4294967295 which is greater than its maximum 4294967294 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 29: resizable limits has a initial page count of 4294967295 which is greater than its maximum 4294967294 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 37: resizable limits has a initial page count of 4294967295 which is greater than its maximum 4294967294 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], [{initial: 2**31, element: "anyfunc"}, - "WebAssembly.Module doesn't parse at byte 24 / 27: Table's initial page count of 2147483648 is too big, maximum 10000000 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", - "WebAssembly.Module doesn't parse at byte 32 / 38: Table's initial page count of 2147483648 is too big, maximum 10000000 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], + "WebAssembly.Module doesn't parse at byte 24: Table's initial page count of 2147483648 is too big, maximum 10000000 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", + "WebAssembly.Module doesn't parse at byte 32: Table's initial page count of 2147483648 is too big, maximum 10000000 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], ]; for (const d of badDescriptions) { @@ -186,7 +186,7 @@ function assertBadTableImport(tableDescription, message) { .Function().End() .Code() .End(); - assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 39 / 48: Cannot have more than one Table for now"); + assert.throws(() => new WebAssembly.Module(builder.WebAssembly().get()), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 39: Cannot have more than one Table for now"); } diff --git a/implementation-contributed/javascriptcore/wasm/js-api/test_Data.js b/implementation-contributed/javascriptcore/wasm/js-api/test_Data.js index cca0cf3bc45d0f4dd33bd9ca59798954d2d45b18..4171435128a084d5949d8ff2b8b12570b7f23375 100644 --- a/implementation-contributed/javascriptcore/wasm/js-api/test_Data.js +++ b/implementation-contributed/javascriptcore/wasm/js-api/test_Data.js @@ -52,7 +52,7 @@ const assertMemoryAllZero = memory => { .Segment([0xff]).Offset(0).End() .End(); const bin = builder.WebAssembly().get(); - assert.throws(() => new WebAssembly.Module(bin), WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte 15 / 20: 0th Data segment has index 0 which exceeds the number of Memories 0`); + assert.throws(() => new WebAssembly.Module(bin), WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte 15: 0th Data segment has index 0 which exceeds the number of Memories 0`); })(); (function EmptyDataSectionWithoutMemory() { @@ -62,7 +62,7 @@ const assertMemoryAllZero = memory => { .Segment([]).Offset(0).End() .End(); const bin = builder.WebAssembly().get(); - assert.throws(() => new WebAssembly.Module(bin), WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte 15 / 19: 0th Data segment has index 0 which exceeds the number of Memories 0`); + assert.throws(() => new WebAssembly.Module(bin), WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte 15: 0th Data segment has index 0 which exceeds the number of Memories 0`); })(); (function DataSectionBiggerThanMemory() { diff --git a/implementation-contributed/javascriptcore/wasm/js-api/test_Start.js b/implementation-contributed/javascriptcore/wasm/js-api/test_Start.js index b44456932d90b5c833145ec3f342fc5046f79e0b..5c3150e1cabebfb84333ef71423a8886cde0eae8 100644 --- a/implementation-contributed/javascriptcore/wasm/js-api/test_Start.js +++ b/implementation-contributed/javascriptcore/wasm/js-api/test_Start.js @@ -31,5 +31,5 @@ import Builder from '../Builder.js'; .Start(0).End() // Invalid index. .Code().End(); const bin = b.WebAssembly().get(); - assert.throws(() => new WebAssembly.Module(bin), Error, `WebAssembly.Module doesn't parse at byte 17 / 20: Start index 0 exceeds function index space 0 (evaluating 'new WebAssembly.Module(bin)')`); + assert.throws(() => new WebAssembly.Module(bin), Error, `WebAssembly.Module doesn't parse at byte 17: Start index 0 exceeds function index space 0 (evaluating 'new WebAssembly.Module(bin)')`); })(); diff --git a/implementation-contributed/javascriptcore/wasm/js-api/test_basic_api.js b/implementation-contributed/javascriptcore/wasm/js-api/test_basic_api.js index 08e74aa324a71788e5819c4a8bbe7747585b1a89..1a2d2221030451df0645b30ea31bb2748f5536d0 100644 --- a/implementation-contributed/javascriptcore/wasm/js-api/test_basic_api.js +++ b/implementation-contributed/javascriptcore/wasm/js-api/test_basic_api.js @@ -67,7 +67,7 @@ for (const c in constructorProperties) { assert.throws(() => new WebAssembly[c](invalid), TypeError, `first argument must be an ArrayBufferView or an ArrayBuffer (evaluating 'new WebAssembly[c](invalid)')`); for (const buffer of [new ArrayBuffer(), new DataView(new ArrayBuffer()), new Int8Array(), new Uint8Array(), new Uint8ClampedArray(), new Int16Array(), new Uint16Array(), new Int32Array(), new Uint32Array(), new Float32Array(), new Float64Array()]) // FIXME the following should be WebAssembly.CompileError. https://bugs.webkit.org/show_bug.cgi?id=163768 - assert.throws(() => new WebAssembly[c](buffer), Error, `WebAssembly.Module doesn't parse at byte 0 / 0: expected a module of at least 8 bytes (evaluating 'new WebAssembly[c](buffer)')`); + assert.throws(() => new WebAssembly[c](buffer), Error, `WebAssembly.Module doesn't parse at byte 0: expected a module of at least 8 bytes (evaluating 'new WebAssembly[c](buffer)')`); assert.instanceof(new WebAssembly[c](emptyModuleArray), WebAssembly.Module); break; case "Instance": diff --git a/implementation-contributed/javascriptcore/wasm/js-api/version.js b/implementation-contributed/javascriptcore/wasm/js-api/version.js index 81cd7ff0122fb21ce91f80fb51e4c69e14598c47..0486fcfddefd0821d39246cb6408734bfebf22e2 100644 --- a/implementation-contributed/javascriptcore/wasm/js-api/version.js +++ b/implementation-contributed/javascriptcore/wasm/js-api/version.js @@ -5,5 +5,5 @@ for (let version = 0; version < 256; ++version) { if (version === 1) continue; const emptyModuleArray = Uint8Array.of(0x0, 0x61, 0x73, 0x6d, version, 0x00, 0x00, 0x00); - assert.throws(() => new WebAssembly.Module(emptyModuleArray), WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte 8 / 8: unexpected version number ${version} expected 1`); + assert.throws(() => new WebAssembly.Module(emptyModuleArray), WebAssembly.CompileError, `WebAssembly.Module doesn't parse at byte 8: unexpected version number ${version} expected 1`); } diff --git a/implementation-contributed/javascriptcore/wasm/stress/nameSection.wasm b/implementation-contributed/javascriptcore/wasm/stress/nameSection.wasm new file mode 100644 index 0000000000000000000000000000000000000000..24b22b1aeea38e469c3260ba34d5da4a6db12153 Binary files /dev/null and b/implementation-contributed/javascriptcore/wasm/stress/nameSection.wasm differ diff --git a/implementation-contributed/javascriptcore/wasm/stress/streaming-basic.js b/implementation-contributed/javascriptcore/wasm/stress/streaming-basic.js new file mode 100644 index 0000000000000000000000000000000000000000..b3fbc2479f72163dfad32104056ba274359235da --- /dev/null +++ b/implementation-contributed/javascriptcore/wasm/stress/streaming-basic.js @@ -0,0 +1,18 @@ +import * as assert from '../assert.js'; + +var data = read("./nameSection.wasm", "binary"); + +function check(step) +{ + var parser = $vm.createWasmStreamingParser(); + for (var i = 0; i < data.byteLength; i += step) { + parser.addBytes(data.subarray(i, i + Math.min(step, data.byteLength - i))); + } + assert.eq(parser.finalize(), 7); +} + +for (var i = 0; i < 10; ++i) + check(i + 1); +check(100); +check(1000); +check(2000);