Commit df2a9e4a authored by Michael Hudson-Doyle's avatar Michael Hudson-Doyle

runtime/race: fix test so it compiles

I'm not sure what the convert function was intended to be.

Fixes #14011

Change-Id: I29d905bc1827936b9433b20b13b7a0b0ac5f502e
Reviewed-on: https://go-review.googlesource.com/18712Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent d9b32f0c
......@@ -4,9 +4,16 @@
package race_test
import "unsafe"
// golang.org/issue/12225
// The test is that this compiles at all.
//go:noinline
func convert(s string) []byte {
return []byte(s)
}
func issue12225() {
println(*(*int)(unsafe.Pointer(&convert("")[0])))
println(*(*int)(unsafe.Pointer(&[]byte("")[0])))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment