Skip to content
Commit 898c6c0d authored by Hans Wennborg's avatar Hans Wennborg Committed by Copybara-Service
Browse files

[zlib] Set hash_bits to at least 15 when using CRC hashing on ARM

Otherwise a bad match can be chosen by longest_match, since it assumes
that match[2] and scan[2] are equal when the hashes and the other bytes
match. That assumption doesn't hold when using CRC hashing and a low
number of hash bits (which can be set by via the 'memLevel' parameter).

For example, the two hex byte sequences 2a 14 14 14 and 2a 14 db 14
have the same lower 9 bits CRC, and only differ in the third byte. This
could cause longest_match to consider them as matching.

This was already handled for x86; do the same for ARM and add a test.

Bug: 1113596
Change-Id: I251150594264f401e4d8bc6e91b44b39998ab029
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392457


Reviewed-by: default avatarChris Blume <cblume@chromium.org>
Reviewed-by: default avatarAdenilson Cavalcanti <cavalcantii@chromium.org>
Commit-Queue: Chris Blume <cblume@chromium.org>
Auto-Submit: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805076}
GitOrigin-RevId: 3fc5c74f812cda92f34897ed811694eaeb4f7654
parent aec16ef7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment