JSTests:
authorjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Dec 2016 22:08:38 +0000 (22:08 +0000)
committerjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Dec 2016 22:08:38 +0000 (22:08 +0000)
commitb57ca7b5da51b9e33c590d5604713cbe2b222cf3
tree91d5ce7a32399870184e8f482a545e229d04cd87
parentfcd2195c707400d088fa180731e4e0139306e85b
JSTests:
WebAssembly API: improve data section errors
https://bugs.webkit.org/show_bug.cgi?id=165733

Reviewed by Keith Miller.

* wasm/js-api/element-data.js: Added.
(ElementBeforeData.set const):
(ElementBeforeData): check the order of initialization, which is observable on failure
* wasm/js-api/test_Data.js:
(DataSectionWithoutMemory):
(DataSectionOffTheEnd): Deleted.
(DataSectionPartlyOffTheEnd): Deleted.
(DataSectionEmptyOffTheEnd): Deleted.
(DataSectionSeenByStart): Deleted.

Source/JavaScriptCore:
WebAssembly API: improve data section errors, initialize after Element
https://bugs.webkit.org/show_bug.cgi?id=165733

Reviewed by Keith Miller.

* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parseData): Data section without Memory section or import is a validation error
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::dataSegmentFail):
(JSC::WebAssemblyModuleRecord::evaluate): tighten checks (though the spec isn't fully baked), and move after Element initialization

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209874 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/wasm/js-api/element-data.js [new file with mode: 0644]
JSTests/wasm/js-api/test_Data.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wasm/WasmModuleParser.cpp
Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp