]> Cypherpunks repositories - gostls13.git/commit
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)
committerRobert Findley <rfindley@google.com>
Mon, 5 Feb 2024 17:28:36 +0000 (17:28 +0000)
commit10a65649a3b2e34ffe8e4202bfa3df851cea0fb4
tree2e4eb3fee51c3e9a81d1605fd966225a186036a3
parent468f56b10a90176aead2443dc1b6e883a0a41ab8
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#65455

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>
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