RESOLVED FIXED 220918
[WASM-References] Change default value for externref's tables from null to undefined
https://bugs.webkit.org/show_bug.cgi?id=220918
Summary [WASM-References] Change default value for externref's tables from null to un...
Dmitry
Reported 2021-01-25 05:56:09 PST
[WASM-References] Change default value for externref's tables from null to undefined
Attachments
Patch (10.10 KB, patch)
2021-01-25 06:00 PST, Dmitry
no flags
Patch (10.87 KB, patch)
2021-01-26 07:17 PST, Dmitry
no flags
Dmitry
Comment 1 2021-01-25 06:00:24 PST
Yusuke Suzuki
Comment 2 2021-01-25 12:33:30 PST
Comment on attachment 418283 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=418283&action=review r=me with comments. > Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp:126 > + : callFrame->argument(1); Use `uncheckedArgument(1)` since we already checked. > Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.cpp:99 > + defaultValue = callFrame->argument(1); Use `callFrame->uncheckedArgument(1);` since we already checked `callFrame->argumentCount() < 2` > Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.cpp:137 > JSValue value = callFrame->argument(1); > - if (Options::useWebAssemblyReferences() && value.isUndefined()) > - value = jsNull(); > + if (Options::useWebAssemblyReferences() && callFrame->argumentCount() < 2) > + value = defaultValueForTable(table->table()->type()); This needs to be done after if (index >= table->length()) return throwVMRangeError(globalObject, throwScope, "WebAssembly.Table.prototype.set expects an integer less than the length of the table"_s); part. Can you move it, and add test for this?
Dmitry
Comment 3 2021-01-26 07:17:06 PST
Yusuke Suzuki
Comment 4 2021-01-26 12:52:25 PST
Comment on attachment 418416 [details] Patch r=me
Yusuke Suzuki
Comment 5 2021-01-26 12:52:55 PST
Comment on attachment 418416 [details] Patch EWS is getting stuck.
EWS
Comment 6 2021-01-26 13:45:25 PST
Committed r271903: <https://trac.webkit.org/changeset/271903> All reviewed patches have been landed. Closing bug and clearing flags on attachment 418416 [details].
Radar WebKit Bug Importer
Comment 7 2021-01-26 13:46:27 PST
Note You need to log in before you can comment on or make changes to this bug.