aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2021-06-13 10:55:19 +0700
committerCuong Manh Le <cuong.manhle.vn@gmail.com>2021-06-13 05:50:15 +0000
commit67b1b6a2e3a405e3e0b5c6a76f702b2a6071c1f0 (patch)
tree3701ca3518726118fb404c007dd5c52633c7cbe6 /test
parent1ed0d129e9ba9b55e9ae36ac1d7f2766ba16b373 (diff)
downloadgo-67b1b6a2e3a405e3e0b5c6a76f702b2a6071c1f0.tar.gz
go-67b1b6a2e3a405e3e0b5c6a76f702b2a6071c1f0.zip
cmd/compile: allow ir.OSLICE2ARRPTR in mayCall
CL 301650 adds conversion from slice to array ptr. The conversion expression may appear as argument to a function call, so it will be tested by mayCall. But ir.OSLICE2ARRPTR op is not handled by mayCall, causes the compiler crashes. Updates #395 Fixes #46720 Change-Id: I39e1b3e38e224a31f3dec46dbbdc855ff3b2c6a5 Reviewed-on: https://go-review.googlesource.com/c/go/+/327649 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Trust: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/issue46720.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/fixedbugs/issue46720.go b/test/fixedbugs/issue46720.go
new file mode 100644
index 0000000000..3b0151ae84
--- /dev/null
+++ b/test/fixedbugs/issue46720.go
@@ -0,0 +1,15 @@
+// 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() {
+ nonce := make([]byte, 24)
+ g((*[24]byte)(nonce))
+}
+
+//go:noinline
+func g(*[24]byte) {}