diff options
author | David Chase <drchase@google.com> | 2021-03-23 19:55:17 -0400 |
---|---|---|
committer | David Chase <drchase@google.com> | 2021-03-24 03:03:18 +0000 |
commit | 14ef2d8c0155b725226516bd2eeb804a70a95462 (patch) | |
tree | 101d6854f1b939cf8b3c8c4d585879cd26f77388 | |
parent | 87a3ac5f5328ea0a6169cfc44bdb081014fcd3ec (diff) | |
download | go-14ef2d8c0155b725226516bd2eeb804a70a95462.tar.gz go-14ef2d8c0155b725226516bd2eeb804a70a95462.zip |
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 <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
-rw-r--r-- | src/cmd/compile/internal/abi/abiutils.go | 2 |
1 files changed, 1 insertions, 1 deletions
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: |