-
Notifications
You must be signed in to change notification settings - Fork 17.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/{cover,go}: revise fix for pkg init order change with -cover
This patch contains a revised fix for issue #56293, switching to a scheme in which coverage counter variables and meta-data variables are written to a separate output file as opposed to being tacked onto the end of an existing rewritten source file. The advantage of writing counter vars to a separate file is that the Go command can then present that file as the first source file to the compiler when the package is built; this will ensure that counter variable are treated as lexically "before" any other variable that might call an instrumented function as part of its initializer. Updates #56293. Change-Id: Iccb8a6532b976d36ccbd5a2a339882d1f5d19477 Reviewed-on: https://go-review.googlesource.com/c/go/+/499215 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
- Loading branch information
Showing
3 changed files
with
50 additions
and
21 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