aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2021-06-25 01:45:32 +0700
committerCuong Manh Le <cuong.manhle.vn@gmail.com>2021-06-24 18:58:27 +0000
commitcce621431a9bce86527b25898a01a7a693cc56a8 (patch)
tree1cb422ae08e3c803af464c62bdde66e72576f9a0 /test
parent600a2a4ffb9a273a3a1635b60120ffc768741aa9 (diff)
downloadgo-cce621431a9bce86527b25898a01a7a693cc56a8.tar.gz
go-cce621431a9bce86527b25898a01a7a693cc56a8.zip
cmd/compile: fix wrong type in SSA generation for OSLICE2ARRPTR
Fixes #46907 Change-Id: I6a2728d2f2159df583b32f40f6100d3e90c34dd7 Reviewed-on: https://go-review.googlesource.com/c/go/+/330672 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/issue46907.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/fixedbugs/issue46907.go b/test/fixedbugs/issue46907.go
new file mode 100644
index 0000000000..bd82f4f2b1
--- /dev/null
+++ b/test/fixedbugs/issue46907.go
@@ -0,0 +1,11 @@
+// compile
+
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package p
+
+func f(b []byte) []byte {
+ return (*[32]byte)(b[:32])[:]
+}