Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Issue 2469893005: Correct truncation behaviour in WTF::hashInts() (Closed)

Created:
4 years, 1 month ago by Simon Hosie
Modified:
4 years, 1 month ago
CC:
chromium-reviews, blink-reviews, blink-reviews-wtf_chromium.org, Mikhail
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Correct truncation behaviour in WTF::hashInts() Multiplies were being truncated to 32-bit prematurely, thereby failing to implement the advertised algorithm and allowing trivial hash collisions. Also the final shift was calculated incorrectly, and the reference suggests that longRandom should be odd. And with the type promotion happening earlier it's possible to refactor the arithmetic to perform two multiplies rather than three. BUG=661425 Committed: https://crrev.com/31223fba349e0ca9dc98655961767b4c6471744a Cr-Commit-Position: refs/heads/master@{#433384}

Patch Set 1 #

Patch Set 2 : Correct truncation behaviour in WTF::hashInts(). #

Patch Set 3 : remove test logic #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -4 lines) Patch
M third_party/WebKit/Source/wtf/HashFunctions.h View 1 chunk +5 lines, -4 lines 0 comments Download

Messages

Total messages: 28 (17 generated)
Simon Hosie
./wtf_unittests --gtest_filter='HashFunctionsTest.*' Before fix: [==========] Running 3 tests from 1 test case. [----------] Global test ...
4 years, 1 month ago (2016-11-14 23:12:23 UTC) #10
Simon Hosie
4 years, 1 month ago (2016-11-15 19:05:16 UTC) #15
Yuta Kitamura
This would probably cause a perf regression, and I think the benefit of having better ...
4 years, 1 month ago (2016-11-17 11:55:48 UTC) #16
Simon Hosie
On 2016/11/17 11:55:48, Yuta Kitamura wrote: > This would probably cause a perf regression, and ...
4 years, 1 month ago (2016-11-17 17:40:56 UTC) #17
Simon Hosie
On 2016/11/17 17:40:56, Simon Hosie wrote: > I'd better test that. Well that was an ...
4 years, 1 month ago (2016-11-18 02:49:23 UTC) #18
Yuta Kitamura
If the perf does not suffer, I'm okay with landing this. The test, however, seems ...
4 years, 1 month ago (2016-11-18 09:41:37 UTC) #19
Simon Hosie
4 years, 1 month ago (2016-11-19 00:08:02 UTC) #20
cavalcantii1
Adding it to the CQ.
4 years, 1 month ago (2016-11-19 00:43:43 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2469893005/40001
4 years, 1 month ago (2016-11-19 00:44:39 UTC) #24
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 1 month ago (2016-11-19 02:28:19 UTC) #26
commit-bot: I haz the power
4 years, 1 month ago (2016-11-19 02:30:59 UTC) #28
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/31223fba349e0ca9dc98655961767b4c6471744a
Cr-Commit-Position: refs/heads/master@{#433384}

Powered by Google App Engine
This is Rietveld 408576698