]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.22] go/types, types2: ensure that Alias.actual is set in NewAlias
authorRob Findley <rfindley@google.com>
Fri, 2 Feb 2024 23:26:06 +0000 (18:26 -0500)
committerCarlos Amedee <carlos@golang.org>
Tue, 27 Feb 2024 21:23:18 +0000 (21:23 +0000)
commit3b719980785f8e055392ec9fddd54212a0c0b257
treeb3df83a50fad7a1d2f639482d63b572b41bb419b
parent8fe2ad6494840553c20565edc42435e99718eb41
[release-branch.go1.22] go/types, types2: ensure that Alias.actual is set in NewAlias

Types returned by the go/types API must be immutable (or at least
concurrency safe), but NewAlias returned an alias without actual set.

Ensure that actual is set by unaliasing. Also make some superficial
simplifications to unalias, and avoid indirection where unnecessary.

Fixes golang/go#65728

Change-Id: Ic9a020da5accf9032056a924b65c9e9e08cb2e0a
Reviewed-on: https://go-review.googlesource.com/c/go/+/560915
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Robert Griesemer <gri@google.com>
(cherry picked from commit 10a65649a3b2e34ffe8e4202bfa3df851cea0fb4)
Reviewed-on: https://go-review.googlesource.com/c/go/+/564356
src/cmd/compile/internal/types2/alias.go
src/cmd/compile/internal/types2/api_test.go
src/go/types/alias.go
src/go/types/api_test.go