]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/load: clone pgo variant's PackagePublic.Imports in split
authorMichael Matloob <matloob@golang.org>
Fri, 24 May 2024 19:18:00 +0000 (15:18 -0400)
committerMichael Matloob <matloob@golang.org>
Tue, 28 May 2024 17:00:51 +0000 (17:00 +0000)
commit94aeedc33a4434f0d410be7c42e0bbcdaedd790f
tree79b32a412e86f764c3c50aac3b31b3b533b372dc
parent377646589d5fb0224014683e0d1f1db35e60c3ac
cmd/go/internal/load: clone pgo variant's PackagePublic.Imports in split

Before this change the pgo and non-pgo variants Imports slices pointed
to the same array, so modifying the pgo variant's Imports slice to add
the .ForMain suffix modified the non-pgo vairant's Imports slice too.
This change clones the imports slice to avoid that.

Fixes #66218

Change-Id: Ic936086f2c31f2056988d6546216142e4fce4d8d
Reviewed-on: https://go-review.googlesource.com/c/go/+/588275
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Auto-Submit: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/go/internal/load/pkg.go
src/cmd/go/testdata/script/list_pgo_issue66218.txt [new file with mode: 0644]