Fix GCC warning about memcpy into a StructureID* buffer
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].
<rdar://problem/85939821>