[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:50:00 PDT 2019


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

--- Comment #12 from Saagar Jha <saagarjha at apple.com> ---
(In reply to Filip Pizlo from comment #11)
> (In reply to Saagar Jha from comment #0)
> 
> 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.

Note that the way WebKit was using these was not a "feature of the language": strictly speaking, the code was invalid C++, and this patch ensures that the code cannot be miscompiled in the future. From a practical standpoint I understand that we already have undefined behavior in our code that we will never be able to completely remove (either because we can't find it, or because we need to do something that cannot be legally expressed in the language)–but I don't see why we should be opposed to changes that remove undefined behavior with no regression in execution speed (if JavaScript ever adds a long keyword, I think this change might actually *improve* performance). Especially if those changes replace a hundred lines of specialized and somewhat tedious macros with an easier-to-maintain solution ;)

-- 
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/cfe26b8f/attachment.html>


More information about the webkit-unassigned mailing list