]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.18] cmd/compile: don't include instantiating types in type hash
authorKeith Randall <khr@golang.org>
Wed, 2 Mar 2022 23:08:23 +0000 (15:08 -0800)
committerDmitri Shuralyov <dmitshur@golang.org>
Fri, 4 Mar 2022 20:56:13 +0000 (20:56 +0000)
commit9f5e2849e12b10e3ca43ac85b00c40e506e83317
tree3998450feec811df9497fb5d67610070610bc30a
parent77a142486e59ec8fca135101ca988bb99208d494
[release-branch.go1.18] cmd/compile: don't include instantiating types in type hash

This CL is a bit overkill, but it is pretty safe for 1.18. We'll
want to revisit for 1.19 so we can avoid the hash collisions between
types, e.g. G[int] and G[float64], that will cause some slowdowns
(but not incorrect behavior). Thanks Cherry for the simple idea.

Fixes #51250

Change-Id: I68130e09ba68e7cc35687bc623f63547bc552867
Reviewed-on: https://go-review.googlesource.com/c/go/+/389474
Trust: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
(cherry picked from commit d3672054fb58d5eaa241f15fa9d7fb9d61e9ac05)
Reviewed-on: https://go-review.googlesource.com/c/go/+/390017
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/reflectdata/reflect.go
src/cmd/compile/internal/types/fmt.go
test/typeparam/issue51250a.dir/a.go [new file with mode: 0644]
test/typeparam/issue51250a.dir/b.go [new file with mode: 0644]
test/typeparam/issue51250a.dir/main.go [new file with mode: 0644]
test/typeparam/issue51250a.go [new file with mode: 0644]