]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: fix array case in types-for-register parameter
authorDavid Chase <drchase@google.com>
Tue, 23 Mar 2021 23:55:17 +0000 (19:55 -0400)
committerDavid Chase <drchase@google.com>
Wed, 24 Mar 2021 03:03:18 +0000 (03:03 +0000)
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>
src/cmd/compile/internal/abi/abiutils.go

index 8495ed7c51916cb8682e94092c2c899fb15d3657..549c11306a797b6a83f59f934ce725c64dd4dd7f 100644 (file)
@@ -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: