ASSERTION FAILED: length > offset encountered with wasm.yaml/wasm/js-api/test_Module...
authorjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Nov 2016 23:07:15 +0000 (23:07 +0000)
committerjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Nov 2016 23:07:15 +0000 (23:07 +0000)
commit8b063d1f935dd57afbb677545959321cb954f8bf
tree8b802ec1e8c255418861a5d5a9ee4cb275515fd2
parent65d7927c2dbb08ced4d7218012400fdca31304ad
ASSERTION FAILED: length > offset encountered with wasm.yaml/wasm/js-api/test_Module.js.default-wasm
https://bugs.webkit.org/show_bug.cgi?id=164597

Reviewed by Keith Miller.

JSTests:

Trim the array buffer before returning it: it's optimistically
over-allocated to avoid growing all the time, but when parsed it
can't have extra content.

* wasm/Builder_WebAssemblyBinary.js:
(export.const.Binary):
* wasm/LowLevelBinary.js:
(export.default.LowLevelBinary.prototype.get return):

Source/JavaScriptCore:

* wasm/WasmParser.h:
(JSC::Wasm::Parser::parseVarUInt32): move closer to other parsers
(JSC::Wasm::Parser::parseVarUInt64): move closer to other parsers

Source/WTF:

Decoding at end of file should fail, not assert.

* wtf/LEBDecoder.h:
(WTF::LEBDecoder::decodeUInt):
(WTF::LEBDecoder::decodeInt32):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208567 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/wasm/Builder_WebAssemblyBinary.js
JSTests/wasm/LowLevelBinary.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wasm/WasmParser.h
Source/WTF/ChangeLog
Source/WTF/wtf/LEBDecoder.h