Summary: | [JSC] AbstractValue can contain padding which is not zero-filled | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> | ||||||||
Component: | New Bugs | Assignee: | Yusuke Suzuki <ysuzuki> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | cgarcia, commit-queue, keith_miller, mark.lam, msaboff, saam | ||||||||
Priority: | P2 | ||||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 161268, 161308 | ||||||||||
Attachments: |
|
Description
Yusuke Suzuki
2016-08-30 23:06:38 PDT
Created attachment 287489 [details]
Patch
Note that this is not GTK+ specific, JSCOnly compiled with GCC also fails, so it's more GCC vs clang issue. Created attachment 287493 [details]
Patch
(In reply to comment #2) > Note that this is not GTK+ specific, JSCOnly compiled with GCC also fails, > so it's more GCC vs clang issue. Renamed the issue & ChangeLog :) Comment on attachment 287489 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=287489&action=review Thanks for working on this! > Source/JavaScriptCore/ChangeLog:12 > + So debug assertion fails in GTK port. So debug assertion fails when building with GCC. > Source/JavaScriptCore/dfg/DFGAbstractValue.cpp:547 > +void AbstractValue::ensureCanInitializeWithZeros() > +{ > + std::aligned_storage<sizeof(AbstractValue), alignof(AbstractValue)>::type zeroFilledStorage; > + memset(static_cast<void*>(&zeroFilledStorage), 0, sizeof(AbstractValue)); > + ASSERT(*this == *static_cast<AbstractValue*>(static_cast<void*>(&zeroFilledStorage))); > +} This is only used inside a #if USE(JSVALUE64) && !defined(NDEBUG) block, so maybe it should be defined using the same #if. > Source/JavaScriptCore/dfg/DFGAbstractValue.h:461 > + void ensureCanInitializeWithZeros(); Ditto. Created attachment 287495 [details]
Patch
Comment on attachment 287489 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=287489&action=review >> Source/JavaScriptCore/ChangeLog:12 >> + So debug assertion fails in GTK port. > > So debug assertion fails when building with GCC. Thanks. Fixed. >> Source/JavaScriptCore/dfg/DFGAbstractValue.cpp:547 >> +} > > This is only used inside a #if USE(JSVALUE64) && !defined(NDEBUG) block, so maybe it should be defined using the same #if. OK, wrapped. >> Source/JavaScriptCore/dfg/DFGAbstractValue.h:461 >> + void ensureCanInitializeWithZeros(); > > Ditto. Done. Comment on attachment 287495 [details]
Patch
r=me
Comment on attachment 287495 [details]
Patch
Thanks!
Comment on attachment 287495 [details] Patch Clearing flags on attachment: 287495 Committed r205254: <http://trac.webkit.org/changeset/205254> All reviewed patches have been landed. Closing bug. |