RESOLVED FIXED 281994
Add static_assert to spanReinterpretCast<>() to prevent unnecessary casts
https://bugs.webkit.org/show_bug.cgi?id=281994
Summary Add static_assert to spanReinterpretCast<>() to prevent unnecessary casts
David Kilzer (:ddkilzer)
Reported 2024-10-23 10:40:46 PDT
Add static_assert to spanReinterpretCast<>() to prevent unnecessary casts. Idea from Darin Adler here: <https://github.com/WebKit/WebKit/pull/35601#discussion_r1811793553> This was seen once in Source/WTF/wtf/text/AtomStringImpl.cpp prior to fixing Bug 281944: ``` RefPtr<AtomStringImpl> AtomStringImpl::add(std::span<const char8_t> characters) { HashedUTF8Characters buffer { characters, computeUTF16LengthWithHash(spanReinterpretCast<const char8_t>(characters)) }; [...] ```
Attachments
Radar WebKit Bug Importer
Comment 1 2024-10-23 10:53:55 PDT
David Kilzer (:ddkilzer)
Comment 2 2024-10-23 11:35:54 PDT
EWS
Comment 3 2024-10-23 14:33:36 PDT
Committed 285623@main (4543cc7cb73c): <https://commits.webkit.org/285623@main> Reviewed commits have been landed. Closing PR #35638 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.