Bug 161009 - Clean up FontPlatformData::hash()
Summary: Clean up FontPlatformData::hash()
Status: RESOLVED DUPLICATE of bug 167061
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-19 12:58 PDT by Myles C. Maxfield
Modified: 2017-01-18 13:51 PST (History)
0 users

See Also:


Attachments
Patch (6.33 KB, patch)
2016-08-19 13:01 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (6.35 KB, patch)
2016-08-19 20:23 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (6.40 KB, patch)
2016-08-19 20:25 PDT, Myles C. Maxfield
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews116 for mac-yosemite (472.55 KB, application/zip)
2016-08-19 21:09 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2016-08-19 12:58:09 PDT
Clean up FontPlatformData::hash()
Comment 1 Myles C. Maxfield 2016-08-19 13:01:08 PDT
Created attachment 286470 [details]
Patch
Comment 2 Myles C. Maxfield 2016-08-19 20:23:09 PDT
Created attachment 286520 [details]
Patch
Comment 3 Myles C. Maxfield 2016-08-19 20:25:47 PDT
Created attachment 286521 [details]
Patch
Comment 4 Build Bot 2016-08-19 21:09:13 PDT
Comment on attachment 286521 [details]
Patch

Attachment 286521 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/1903880

Number of test failures exceeded the failure limit.
Comment 5 Build Bot 2016-08-19 21:09:15 PDT
Created attachment 286523 [details]
Archive of layout-test-results from ews116 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews116  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 6 Darin Adler 2016-08-20 18:33:48 PDT
Comment on attachment 286521 [details]
Patch

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

> Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm:61
> +unsigned FontPlatformData::hash() const
> +{
> +    uintptr_t flags = static_cast<uintptr_t>(m_isHashTableDeletedValue << 5 | m_textRenderingMode << 3 | m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique);
> +    uintptr_t fontHash = reinterpret_cast<uintptr_t>(m_font.get());
> +    uintptr_t hashCodes[3] = { fontHash, m_widthVariant, flags };
> +    return StringHasher::hashMemory<sizeof(hashCodes)>(hashCodes);
> +}

This doesn’t look right. The hash function should hash the same things that the is-equal function compares. Yet this is hashing things that platformIsEqual does not even look at. Can that really be correct?
Comment 7 Myles C. Maxfield 2017-01-18 13:51:44 PST

*** This bug has been marked as a duplicate of bug 167061 ***