WebKit Bugzilla
Attachment 343002 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
b-backup.diff (text/plain), 3.65 KB, created by
Saam Barati
on 2018-06-18 18:54:22 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Saam Barati
Created:
2018-06-18 18:54:22 PDT
Size:
3.65 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 NOBODY (OOPS!). >+ >+ * 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,19 @@ >+import * as assert from '../assert.js'; >+import Builder from '../Builder.js'; >+ >+const builder = (new Builder()) >+ >+builder.Type().End() >+ .Function().End() >+ .Memory().InitialMaxPages(1, 1).End() >+ .Export() >+ .Function("callFunc") >+ .End() >+ .Code() >+ .Function("callFunc", { params: ["i32", "i32", "void"], ret: "void" }) >+ .Return() >+ .End() >+ .End(); >+ >+const bin = builder.WebAssembly().get(); >+assert.throws(() => new WebAssembly.Module(bin), WebAssembly.CompileError, "WebAssembly.Module doesn't parse at byte 16 / 48: Argument number 2 has type Void. An argument cannot be of type Void."); >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 NOBODY (OOPS!). >+ >+ * 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) >@@ -127,6 +127,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(argumentType == Type::Void, "Argument number ", i, " has type Void. An argument cannot be of type Void."); > 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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186794
:
343002
|
343004
|
343016
|
343028
|
343068