]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.7] hash/crc32: fix optimized s390x implementation
authorMichael Munday <munday@ca.ibm.com>
Sun, 21 Aug 2016 01:09:53 +0000 (21:09 -0400)
committerChris Broadfoot <cbro@golang.org>
Wed, 7 Sep 2016 17:46:02 +0000 (17:46 +0000)
commita5add8c7260b5b7d49488eaf60ab49804df095e6
treedcc4399bec2735cb170fcf69d9a0c8e9cd22f724
parente464c08beffc87cb064e48932699042b3dccc491
[release-branch.go1.7] hash/crc32: fix optimized s390x implementation

The code wasn't checking to see if the data was still >= 64 bytes
long after aligning it.

Aligning the data is an optimization and we don't actually need
to do it. In fact for smaller sizes it slows things down due to
the overhead of calling the generic function. Therefore for now
I have simply removed the alignment stage. I have also added a
check into the assembly to deliberately trigger a segmentation
fault if the data is too short.

Fixes #16779.

Change-Id: Ic01636d775efc5ec97689f050991cee04ce8fe73
Reviewed-on: https://go-review.googlesource.com/27409
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/28635
src/hash/crc32/crc32_s390x.go
src/hash/crc32/crc32_s390x.s