aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2017-08-17 11:29:19 -0400
committerRuss Cox <rsc@golang.org>2017-08-26 00:52:14 +0000
commit497ad3015b7f786ccee5b90c0eb65e55cee67151 (patch)
tree1b32fec013e52b1edd5f1453b64d6085654d0048
parent73f9e2727659d76d6dfd466c94d2aa179aa6fe48 (diff)
downloadgo-497ad3015b7f786ccee5b90c0eb65e55cee67151.tar.gz
go-497ad3015b7f786ccee5b90c0eb65e55cee67151.zip
[dev.boringcrypto.go1.8] runtime/race: move TestRaceIssue5567 from sha1 to crc32
If we substitute a SHA1 implementation where the entirety of the reading of the buffer is done in assembly (or C called from cgo), then the race detector cannot observe the race. Change to crc32 with a fake polynomial, in the hope that it will always be handled by Go code, not optimized assembly or cgo calls. Change-Id: I34e90b14ede6bc220ef686f6aef16b8e464b5cde Reviewed-on: https://go-review.googlesource.com/56510 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-on: https://go-review.googlesource.com/57934 Reviewed-by: Adam Langley <agl@golang.org>
-rw-r--r--src/runtime/race/testdata/mop_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/race/testdata/mop_test.go b/src/runtime/race/testdata/mop_test.go
index c96acb9021..560a762315 100644
--- a/src/runtime/race/testdata/mop_test.go
+++ b/src/runtime/race/testdata/mop_test.go
@@ -6,9 +6,9 @@ package race_test
import (
"bytes"
- "crypto/sha1"
"errors"
"fmt"
+ "hash/crc32"
"io"
"os"
"runtime"
@@ -1904,7 +1904,7 @@ func TestRaceIssue5567(t *testing.T) {
err = nil
}
}()
- h := sha1.New()
+ h := crc32.New(crc32.MakeTable(0x12345678))
for b := range in {
h.Write(b)
}