]> Cypherpunks.ru repositories - gostls13.git/commit
go/types, types2: pass the seen map through _TypeSet.IsComparable
authorRobert Findley <rfindley@google.com>
Mon, 24 Jan 2022 20:42:52 +0000 (15:42 -0500)
committerRobert Findley <rfindley@google.com>
Mon, 24 Jan 2022 22:28:27 +0000 (22:28 +0000)
commit84eefdc933410907495e42aac872036403851ffa
treea602b6767e48f59421d69e8018f6461c1b280825
parent671e1150c680eb5f21833662362954cc1b155d2b
go/types, types2: pass the seen map through _TypeSet.IsComparable

While checking comparability of type parameters, we recurse through
_TypeSet.IsComparable, but do not pass the cycle-tracking seen map,
resulting in infinite recursion in some cases.

Refactor to pass the seen map through this recursion.

Fixes #50782

Change-Id: I2c2bcfed3398c11eb9aa0c871da59e348bfba5f7
Reviewed-on: https://go-review.googlesource.com/c/go/+/380504
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/types2/interface.go
src/cmd/compile/internal/types2/predicates.go
src/cmd/compile/internal/types2/testdata/fixedbugs/issue50782.go2 [new file with mode: 0644]
src/cmd/compile/internal/types2/typeset.go
src/go/types/interface.go
src/go/types/predicates.go
src/go/types/testdata/fixedbugs/issue50782.go2 [new file with mode: 0644]
src/go/types/typeset.go