mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: minor cleanup
Follow-up to review comments on CL 41797. Mask the input to set2 and set3, so that at the very least, we won't corrupt the rest of the flags in case of a bad input. It also seems more semantically appropriate. Do minor cleanup in addrescapes. I started on larger cleanup, but it wasn't clear that it was an improvement. Add warning comments and sanity checks to Initorder and Class constants, to attempt to prevent them from overflowing their allotted flag bits. Passes toolstash-check. Change-Id: I57b9661ba36f56406aa7a1d8da9b7c70338f9119 Reviewed-on: https://go-review.googlesource.com/41817 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
6910e1085b
commit
e1a7db7f3b
4 changed files with 28 additions and 19 deletions
|
|
@ -9,11 +9,12 @@ import (
|
|||
"fmt"
|
||||
)
|
||||
|
||||
// static initialization
|
||||
// Static initialization ordering state.
|
||||
// These values are stored in two bits in Node.flags.
|
||||
const (
|
||||
InitNotStarted = 0
|
||||
InitDone = 1
|
||||
InitPending = 2
|
||||
InitNotStarted = iota
|
||||
InitDone
|
||||
InitPending
|
||||
)
|
||||
|
||||
type InitEntry struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue