mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: add sizeCalculationDisabled flag
Use it to ensure that dowidth is not called from the backend on a type whose size has not yet been calculated. This is an alternative to CL 42016. Change-Id: I8c7b4410ee4c2a68573102f6b9b635f4fdcf392e Reviewed-on: https://go-review.googlesource.com/42018 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
dae5389d3d
commit
c51559813f
4 changed files with 22 additions and 15 deletions
|
|
@ -254,6 +254,7 @@ func compileSSA(fn *Node, worker int) {
|
|||
// and waits for them to complete.
|
||||
func compileFunctions() {
|
||||
if len(compilequeue) != 0 {
|
||||
sizeCalculationDisabled = true // not safe to calculate sizes concurrently
|
||||
if raceEnabled {
|
||||
// Randomize compilation order to try to shake out races.
|
||||
tmp := make([]*Node, len(compilequeue))
|
||||
|
|
@ -287,6 +288,7 @@ func compileFunctions() {
|
|||
close(c)
|
||||
compilequeue = nil
|
||||
wg.Wait()
|
||||
sizeCalculationDisabled = false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue