WebKit Bugzilla
Attachment 343004 Details for
Bug 186794
: Wasm: Any function argument of type Void should be a validation error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for landing
b-backup.diff (text/plain), 4.00 KB, created by
Saam Barati
on 2018-06-18 19:03:07 PDT
(
hide
)
Description:
patch for landing
Filename:
MIME Type:
Creator:
Saam Barati
Created:
2018-06-18 19:03:07 PDT
Size:
4.00 KB
patch
obsolete
>Index: JSTests/ChangeLog >=================================================================== >--- JSTests/ChangeLog (revision 232953) >+++ JSTests/ChangeLog (working copy) >@@ -1,3 +1,15 @@ >+2018-06-18 Saam Barati <sbarati@apple.com> >+ >+ Wasm: Any function argument of type Void should be a validation error >+ https://bugs.webkit.org/show_bug.cgi?id=186794 >+ <rdar://problem/41140257> >+ >+ Reviewed by Keith Miller. >+ >+ * wasm/Builder.js: >+ (const._normalizeFunctionSignature): >+ * wasm/function-tests/void-argument-type-should-be-a-validation-error.js: Added. >+ > 2018-06-18 Keith Miller <keith_miller@apple.com> > > Properly zero unused property storage offsets >Index: JSTests/wasm/Builder.js >=================================================================== >--- JSTests/wasm/Builder.js (revision 232951) >+++ JSTests/wasm/Builder.js (working copy) >@@ -43,8 +43,6 @@ const _unknownSectionId = 0; > > const _normalizeFunctionSignature = (params, ret) => { > assert.isArray(params); >- for (const p of params) >- assert.truthy(WASM.isValidValueType(p), `Type parameter ${p} needs a valid value type`); > if (typeof(ret) === "undefined") > ret = "void"; > assert.isNotArray(ret, `Multiple return values not supported by WebAssembly yet`); >Index: JSTests/wasm/function-tests/void-argument-type-should-be-a-validation-error.js >=================================================================== >--- JSTests/wasm/function-tests/void-argument-type-should-be-a-validation-error.js (nonexistent) >+++ JSTests/wasm/function-tests/void-argument-type-should-be-a-validation-error.js (working copy) >@@ -0,0 +1,22 @@ >+import * as assert from '../assert.js'; >+import Builder from '../Builder.js'; >+ >+function getBinary(params) { >+ const builder = (new Builder()) >+ builder.Type().End() >+ .Function().End() >+ .Memory().InitialMaxPages(1, 1).End() >+ .Export() >+ .Function("callFunc") >+ .End() >+ .Code() >+ .Function("callFunc", { params, ret: "void" }) >+ .Return() >+ .End() >+ .End(); >+ 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"); >Index: Source/JavaScriptCore/ChangeLog >=================================================================== >--- Source/JavaScriptCore/ChangeLog (revision 232951) >+++ Source/JavaScriptCore/ChangeLog (working copy) >@@ -1,3 +1,14 @@ >+2018-06-18 Saam Barati <sbarati@apple.com> >+ >+ Wasm: Any function argument of type Void should be a validation error >+ https://bugs.webkit.org/show_bug.cgi?id=186794 >+ <rdar://problem/41140257> >+ >+ Reviewed by Keith Miller. >+ >+ * wasm/WasmModuleParser.cpp: >+ (JSC::Wasm::ModuleParser::parseType): >+ > 2018-06-18 Keith Miller <keith_miller@apple.com> > > Properly zero unused property storage offsets >Index: Source/JavaScriptCore/wasm/WasmModuleParser.cpp >=================================================================== >--- Source/JavaScriptCore/wasm/WasmModuleParser.cpp (revision 232951) >+++ Source/JavaScriptCore/wasm/WasmModuleParser.cpp (working copy) >@@ -126,7 +126,7 @@ auto ModuleParser::parseType() -> Partia > > for (unsigned i = 0; i < argumentCount; ++i) { > Type argumentType; >- WASM_PARSER_FAIL_IF(!parseResultType(argumentType), "can't get ", i, "th argument Type"); >+ WASM_PARSER_FAIL_IF(!parseValueType(argumentType), "can't get ", i, "th argument Type"); > signature->argument(i) = argumentType; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186794
:
343002
|
343004
|
343016
|
343028
|
343068