-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go/types/typeutil: don't recurse into constraints when hashing tparams
When hashing signature type parameters, we recursed into their constraints in an attempt to improve the accuracy of the hash (signatures are considered identical modulo type parameter renaming). This introduces a mechanism for infinite recursion via recursive constraints, as reported in golang/go#51314. To fix this, we can hash just the type parameter index and rely on types.Identical for de-duplicating map entries. Fixes golang/go#51314 Change-Id: Ifd7596d978b98293391bbe64f72f1da2b2a5d51c Reviewed-on: https://go-review.googlesource.com/c/tools/+/387754 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Tim King <taking@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
- Loading branch information
Showing
2 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters