I'm not sure what the convert function was intended to be.
Fixes #14011
Change-Id: I29d905bc1827936b9433b20b13b7a0b0ac5f502e
Reviewed-on: https://go-review.googlesource.com/18712
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
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])))