Bug 232927 - Hasher should be able to hash pointers
Summary: Hasher should be able to hash pointers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antti Koivisto
URL:
Keywords: InRadar
Depends on:
Blocks: 232930
  Show dependency treegraph
 
Reported: 2021-11-10 01:12 PST by Antti Koivisto
Modified: 2021-11-10 05:46 PST (History)
6 users (show)

See Also:


Attachments
Patch (2.81 KB, patch)
2021-11-10 01:25 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
Patch for landing (2.70 KB, patch)
2021-11-10 03:56 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2021-11-10 01:12:35 PST
Currently the implicitly convert to bool leading bad results.
Comment 1 Antti Koivisto 2021-11-10 01:25:41 PST
Created attachment 443782 [details]
Patch
Comment 2 Kimmo Kinnunen 2021-11-10 02:49:11 PST
Comment on attachment 443782 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=443782&action=review

> Tools/TestWebKitAPI/Tests/WTF/Hasher.cpp:200
> +    EXPECT_EQ(is32Bit ? zero32BitHash : zero64BitHash, computeHash(nullPtr));

maybe use just uintptr_t, not is32Bit
Comment 3 Kimmo Kinnunen 2021-11-10 02:49:58 PST
Comment on attachment 443782 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=443782&action=review

> Tools/TestWebKitAPI/Tests/WTF/Hasher.cpp:202
> +    EXPECT_EQ(is32Bit ? computeHash(static_cast<uint32_t>(0xffffff)) : computeHash(static_cast<uint64_t>(0xffffff)), computeHash(ffffffPtr));

maybe test 
  computeHash(nullptr) == computeHash(nullPtr)
Comment 4 Antti Koivisto 2021-11-10 03:56:31 PST
Created attachment 443796 [details]
Patch for landing
Comment 5 EWS 2021-11-10 04:49:32 PST
Committed r285572 (244080@main): <https://commits.webkit.org/244080@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 443796 [details].
Comment 6 Radar WebKit Bug Importer 2021-11-10 04:50:22 PST
<rdar://problem/85250129>