Fix crashes due to mishandling custom sections.
Created attachment 332906 [details] Patch
rdar://problem/36935863
Comment on attachment 332906 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=332906&action=review r=me > Source/JavaScriptCore/wasm/WasmModuleParser.cpp:58 > + // This is not really a known section extra space > Source/JavaScriptCore/wasm/WasmSections.h:55 > + // It's important that Begin is less than every other section number and that Custom is greater. > + // This only works because section numbers are currently monotonically increasing and we don't support > + // any custom sections. Also, Begin is not a real section but is used as a marker for validating the ordering > + // of sections. > + Begin = 0, static_assert please
Comment on attachment 332906 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=332906&action=review r=me > Source/JavaScriptCore/wasm/WasmSections.h:53 > + // any custom sections. Also, Begin is not a real section but is used as a marker for validating the ordering We support the "name" custom section. > Source/JavaScriptCore/wasm/WasmSections.h:77 > + if (!sectionByte) Compare to static_cast<uint8_t>(Section::Custom) instead?
Comment on attachment 332906 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=332906&action=review >> Source/JavaScriptCore/wasm/WasmSections.h:53 >> + // any custom sections. Also, Begin is not a real section but is used as a marker for validating the ordering > > We support the "name" custom section. Oh right, I'll change the comment. >> Source/JavaScriptCore/wasm/WasmSections.h:55 >> + Begin = 0, > > static_assert please What static assert are you looking for? Begin < Type? >> Source/JavaScriptCore/wasm/WasmSections.h:77 >> + if (!sectionByte) > > Compare to static_cast<uint8_t>(Section::Custom) instead? That would be incorrect...
Created attachment 332914 [details] Patch for landing
Committed r227994: <https://trac.webkit.org/changeset/227994>
*** Bug 182208 has been marked as a duplicate of this bug. ***