Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a7e29096ee4794aedf998e34529700719dc5f5a4
      
https://github.com/WebKit/WebKit/commit/a7e29096ee4794aedf998e34529700719dc5f5a4
  Author: Antti Koivisto <[email protected]>
  Date:   2023-10-09 (Mon, 09 Oct 2023)

  Changed paths:
    M Source/WTF/wtf/Hasher.h
    M Tools/TestWebKitAPI/Tests/WTF/Hasher.cpp

  Log Message:
  -----------
  WTF::computeHash() with RefPtr/CheckedPtr hashes the result of implicit 
boolean conversion
https://bugs.webkit.org/show_bug.cgi?id=262891
rdar://116679372

Reviewed by Simon Fraser.

This can result in terrible hashing if the key contains RefPtrs, for example

using ResolverSharingKey = std::tuple<Vector<RefPtr<StyleSheetContents>>, bool, 
bool>;

in Style::Scope.

* Source/WTF/wtf/Hasher.h:
(WTF::add):

Add specializations for RefPtr and CheckedPtr so we don't hit the implicit 
boolean conversion.

* Tools/TestWebKitAPI/Tests/WTF/Hasher.cpp:
(TestWebKitAPI::TEST):

Canonical link: https://commits.webkit.org/269081@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to