]> Cypherpunks.ru repositories - gostls13.git/commit
go/types, types2: use correct parameter list when checking argument passing
authorRobert Griesemer <gri@golang.org>
Mon, 14 Aug 2023 22:56:08 +0000 (15:56 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 15 Aug 2023 21:01:03 +0000 (21:01 +0000)
commitf2f5979253717ce939d75f57c9f8be3de849a875
tree7415d177add40db85b9524eaaf5120eb2f689358
parent3be2176d92ad318b9085980b0b7f09f30541afb3
go/types, types2: use correct parameter list when checking argument passing

The existing code was simply wrong: we cannot ever use the result
signature parameter list (rsig.params) if sigParams was adjusted
for variadic functions. If it was adjusted, we always must either
use sigParams or its separately instantiated version.

In the condition "n > 0 && adjusted", the "n > 0" should have
been in either of the respective "if statement" branches.

Simplified the code by merging with the result signature parameter
update.

Fixes #61931.

Change-Id: I5d39bc8bbc4dd85c7c985055d29532b4b176955e
Reviewed-on: https://go-review.googlesource.com/c/go/+/519456
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/call.go
src/cmd/compile/internal/types2/issues_test.go
src/go/types/call.go
src/go/types/issues_test.go