From 14ef2d8c0155b725226516bd2eeb804a70a95462 Mon Sep 17 00:00:00 2001 From: David Chase Date: Tue, 23 Mar 2021 19:55:17 -0400 Subject: cmd/compile: fix array case in types-for-register parameter Corrected typo/thinko. We should keep the test for this, but it doesn't run yet because of reflection as far as I know (but I am not testing w/ GOEXPERIMENT). See https://github.com/golang/go/issues/44816#issuecomment-805297295 Updates #40724 Updates #44816 Change-Id: Ia12d0d4db00a8ec7174e72de460173876bd17874 Reviewed-on: https://go-review.googlesource.com/c/go/+/304233 Trust: David Chase Run-TryBot: David Chase TryBot-Result: Go Bot Reviewed-by: Cherry Zhang --- src/cmd/compile/internal/abi/abiutils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/abi/abiutils.go b/src/cmd/compile/internal/abi/abiutils.go index 8495ed7c51..549c11306a 100644 --- a/src/cmd/compile/internal/abi/abiutils.go +++ b/src/cmd/compile/internal/abi/abiutils.go @@ -168,7 +168,7 @@ func appendParamTypes(rts []*types.Type, t *types.Type) []*types.Type { typ := t.Kind() switch typ { case types.TARRAY: - for i := int64(0); i < t.Size(); i++ { // 0 gets no registers, plus future-proofing. + for i := int64(0); i < t.NumElem(); i++ { // 0 gets no registers, plus future-proofing. rts = appendParamTypes(rts, t.Elem()) } case types.TSTRUCT: -- cgit v1.2.3-54-g00ecf