Wasm StreamingParser should validate that number of functions matches number of decla...
authortzagallo@apple.com <tzagallo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Sep 2019 01:40:49 +0000 (01:40 +0000)
committertzagallo@apple.com <tzagallo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Sep 2019 01:40:49 +0000 (01:40 +0000)
commit065e993a85685d7431cc8ffe7ea14594fb040d49
treecac31e1cf75902f96b104625468d08b50aa70fff
parentad47991e60749e99131f3a05d28c61e642fc5f97
Wasm StreamingParser should validate that number of functions matches number of declarations
https://bugs.webkit.org/show_bug.cgi?id=201850
<rdar://problem/55290186>

Reviewed by Yusuke Suzuki.

JSTests:

* wasm/regress/validate-number-of-functions-match-declarations.js: Added.
(catch):

Source/JavaScriptCore:

Currently, when parsing the code section, we check that the number of functions matches the number
of declarations in the function section. However, that check is never performed if the module does
not have a code section. To fix that, we perform the check again in StreamingParser::finalize.

* wasm/WasmStreamingParser.cpp:
(JSC::Wasm::StreamingParser::finalize):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249935 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/wasm/regress/validate-number-of-functions-match-declarations.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wasm/WasmStreamingParser.cpp