-
Notifications
You must be signed in to change notification settings - Fork 17.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/compile: disallow embed of var inside func
Allowing embedding into []byte inside a func creates an unfortunate problem: either all calls start with the same underlying data and can see each other's changes to the underlying data (surprising and racy!) or all calls start by making their own copy of the underlying data (surprising and expensive!). After discussion on #43216, the consensus was to remove support for all vars embedded inside functions. Fixes #43216. Change-Id: I01e62b5f0dcd9e8566c6d2286218e97803f54704 Reviewed-on: https://go-review.googlesource.com/c/go/+/282714 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
- Loading branch information
Showing
3 changed files
with
13 additions
and
42 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
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
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