aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Chase <drchase@google.com>2023-10-10 12:18:43 -0400
committerDavid Chase <drchase@google.com>2023-10-10 16:50:46 +0000
commit1493dd3cfc34dbf18d30ff551bfaf3996430c38a (patch)
tree90e0f18df965082bf9a391b4fa9b087e254f366d /test
parentf34964a5cfa02c4b3c8f7eddf33e8579e1a37443 (diff)
downloadgo-1493dd3cfc34dbf18d30ff551bfaf3996430c38a.tar.gz
go-1493dd3cfc34dbf18d30ff551bfaf3996430c38a.zip
cmd/compile: get rid of zero-sized values in call expansion
Do this by removing all stores of zero-sized anything. Fixes #63433. Change-Id: I5d8271edab992d15d02005fa3fe31835f2eff8fa Reviewed-on: https://go-review.googlesource.com/c/go/+/534296 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/issue63490.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/fixedbugs/issue63490.go b/test/fixedbugs/issue63490.go
new file mode 100644
index 0000000000..740ce9b634
--- /dev/null
+++ b/test/fixedbugs/issue63490.go
@@ -0,0 +1,36 @@
+// compile
+
+// Copyright 2023 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 main
+
+type ResourceFunc struct {
+ junk [8]int
+ base assignmentBaseResource
+}
+
+type SubscriptionAssignmentResource struct {
+ base assignmentBaseResource
+}
+
+type assignmentBaseResource struct{}
+
+//go:noinline
+func (a assignmentBaseResource) f(s string) ResourceFunc {
+ println(s)
+ return ResourceFunc{}
+}
+
+//go:noinline
+func (r SubscriptionAssignmentResource) Hi() ResourceFunc {
+ rf := r.base.f("Hello world")
+ rf.base = r.base
+ return rf
+}
+
+func main() {
+ var r SubscriptionAssignmentResource
+ r.Hi()
+}