]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: prevent unification from recursing endlessly
authorRobert Griesemer <gri@golang.org>
Wed, 12 Jan 2022 04:55:56 +0000 (20:55 -0800)
committerRobert Griesemer <gri@golang.org>
Wed, 12 Jan 2022 19:03:11 +0000 (19:03 +0000)
commitdeb45802a4384ea3c7c3434113fb64a57a494cb2
treeada20c268c18884d770df6f400dc1b6c03c89f4e
parent68b3d36ff4e71d68f25d36caff8b4ba2b3b9c980
go/types, types2: prevent unification from recursing endlessly

This is a stop gap solution to avoid panics due to stack overflow
during type unification. While this doesn't address the underlying
issues (for which we are still investigating the correct approach),
it prevents a panic during compilation and reports a (possibly not
quite correct) error message.

If the programs are correct in the first place, manually providing
the desired type arguments is a viable work-around, resulting in
code that will continue to work even when the issues here are fixed
satisfactorily.

For #48619.
For #48656.

Change-Id: I13bb14552b38b4170b5a1b820e3172d88ff656ec
Reviewed-on: https://go-review.googlesource.com/c/go/+/377954
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/testdata/fixedbugs/issue48619.go2
src/cmd/compile/internal/types2/testdata/fixedbugs/issue48656.go2
src/cmd/compile/internal/types2/unify.go
src/go/types/testdata/fixedbugs/issue48619.go2
src/go/types/testdata/fixedbugs/issue48656.go2
src/go/types/unify.go