[Webkit-unassigned] [Bug 199650] Keyword lookup can use memcmp to get around unaligned load undefined behavior

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jul 17 09:03:36 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=199650

Filip Pizlo <fpizlo at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fpizlo at apple.com

--- Comment #11 from Filip Pizlo <fpizlo at apple.com> ---
(In reply to Saagar Jha from comment #0)
> KeywordLookup.h rolls what appears to be its own custom memcmp to do string
> matches, but it performs unaligned loads, reinterpret_casts, and in general
> makes UBSan very unhappy. 

I don't think these constitute good reasons for landing changes to WebKit because:

- We intentionally use unaligned loads in some parts of the code.
- We intentionally use reinterpret_casts a lot.
- We intentionally do other things that UBSan doesn't agree with.

I don't think we want to change our conventions in regard to those features of the language.

> I think we can use just use memcmp instead
> (someone should check whether I can do this, though: I may be
> misunderstanding how the character encoding works). I have checked that
> Clang and GCC produce reasonable-looking assembly for this if we make what
> we're doing clear enough.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190717/838cf745/attachment.html>


More information about the webkit-unassigned mailing list