Summary: | Add static_assert the value we use to initialize a StructureID buffer should be 0. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Keith Miller <keith_miller> | ||||||
Component: | New Bugs | Assignee: | Keith Miller <keith_miller> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | ews-watchlist, mark.lam, mcatanzaro, msaboff, saam, tzagallo, webkit-bug-importer, ysuzuki | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=233379 | ||||||||
Attachments: |
|
Description
Keith Miller
2021-12-01 13:23:23 PST
Created attachment 445606 [details]
Patch
Comment on attachment 445606 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=445606&action=review > Source/JavaScriptCore/runtime/StructureChain.cpp:52 > + static_assert(!StructureID().bits(), "Make sure the value we're going to memcpy below matches the default StructureID"); This part looks good. > Source/JavaScriptCore/runtime/StructureID.h:55 > + constexpr uint32_t bits() const { return m_bits; } Nice. Created attachment 445607 [details]
Patch for landing
Comment on attachment 445607 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=445607&action=review > Source/JavaScriptCore/runtime/StructureChain.cpp:53 > memset(vector, 0, bytes); I'm skeptical that would be enough to suppress this warning. We'll probably need to do: memset(static_cast<void*>(vector), 0, bytes); If your patch alone isn't enough, I'll just commit this as a follow-up. (In reply to Michael Catanzaro from comment #4) > Comment on attachment 445607 [details] > Patch for landing > > View in context: > https://bugs.webkit.org/attachment.cgi?id=445607&action=review > > > Source/JavaScriptCore/runtime/StructureChain.cpp:53 > > memset(vector, 0, bytes); > > I'm skeptical that would be enough to suppress this warning. We'll probably > need to do: > > memset(static_cast<void*>(vector), 0, bytes); > > If your patch alone isn't enough, I'll just commit this as a follow-up. Oh, this is just the static_assert now since Yusuke already landed a cast change. Ack, see: bug #233379 for the warning fix. Committed r286387 (244744@main): <https://commits.webkit.org/244744@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 445607 [details]. |