Changeset 209955 in webkit
- Timestamp:
- Dec 16, 2016 7:19:48 PM (7 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r209954 r209955 1 2016-12-16 Saam Barati <sbarati@apple.com> 2 3 WebAssembly: We still have some incorrect parsing productions inside unreachable code 4 https://bugs.webkit.org/show_bug.cgi?id=165981 5 6 Reviewed by Keith Miller. 7 8 This hardens our parsing for CallIndirect and Loop/Block/If to be exactly like their reachable variant. 9 10 It also fixes a more nefarious bug in which we were decoding an extra varuint32 11 for Br/BrIf inside unreachable code. 12 13 * wasm/WasmFunctionParser.h: 14 1 15 2016-12-16 Filip Pizlo <fpizlo@apple.com> 2 16 -
trunk/Source/JavaScriptCore/wasm/WasmFunctionParser.h
r209934 r209955 528 528 case Block: { 529 529 m_unreachableBlocks++; 530 int8_tunused;531 WASM_PARSER_FAIL_IF(!parse Int7(unused), "can't get inline type for ", op, " in unreachable context");530 Type unused; 531 WASM_PARSER_FAIL_IF(!parseResultType(unused), "can't get inline type for ", op, " in unreachable context"); 532 532 return { }; 533 533 } … … 546 546 } 547 547 548 case CallIndirect: { 549 uint32_t unused; 550 uint8_t unused2; 551 WASM_PARSER_FAIL_IF(!parseVarUInt32(unused), "can't get call_indirect's signature index in unreachable context"); 552 WASM_PARSER_FAIL_IF(!parseVarUInt1(unused2), "can't get call_indirect's reserved byte in unreachable context"); 553 return { }; 554 } 548 555 549 556 // two immediate cases 550 557 FOR_EACH_WASM_MEMORY_LOAD_OP(CREATE_CASE) 551 FOR_EACH_WASM_MEMORY_STORE_OP(CREATE_CASE) 552 case Br: 553 case BrIf: 554 case CallIndirect: { 558 FOR_EACH_WASM_MEMORY_STORE_OP(CREATE_CASE) { 555 559 uint32_t unused; 556 560 WASM_PARSER_FAIL_IF(!parseVarUInt32(unused), "can't get first immediate for ", op, " in unreachable context"); … … 569 573 case GetGlobal: 570 574 case SetGlobal: 575 case Br: 576 case BrIf: 571 577 case Call: { 572 578 uint32_t unused;
Note: See TracChangeset
for help on using the changeset viewer.