-
Notifications
You must be signed in to change notification settings - Fork 17.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go/types: don't write during sanitizeInfo if nothing has changed
In its final phase, the typechecker walks the types it produces to ensure that no unexpanded type instances leak through the API. However, this also walks shared types (such as those in the universe scope), resulting in a potential data race during concurrent typechecking passes. Fix this by being careful not to write if nothing needs to be changed. Since any shared types should already be sanitized, this should eliminate data races. For #44434 Change-Id: Iadb2e78863efe0e974e69a00e255f26cfaf9386a Reviewed-on: https://go-review.googlesource.com/c/go/+/294411 Trust: Robert Findley <rfindley@google.com> Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
- Loading branch information
Showing
1 changed file
with
63 additions
and
19 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