// have not already been calculated, it calls Fatal.
// This is used to prevent data races in the back end.
func dowidth(t *types.Type) {
+ // Calling dowidth when typecheck tracing enabled is not safe.
+ // See issue #33658.
+ if enableTrace && skipDowidthForTracing {
+ return
+ }
if Widthptr == 0 {
Fatalf("dowidth without betypeinit")
}
var trace bool
var traceIndent []byte
+var skipDowidthForTracing bool
func tracePrint(title string, n *Node) func(np **Node) {
indent := traceIndent
tc = n.Typecheck()
}
+ skipDowidthForTracing = true
+ defer func() { skipDowidthForTracing = false }()
fmt.Printf("%s: %s%s %p %s %v tc=%d\n", pos, indent, title, n, op, n, tc)
traceIndent = append(traceIndent, ". "...)
typ = n.Type
}
+ skipDowidthForTracing = true
+ defer func() { skipDowidthForTracing = false }()
fmt.Printf("%s: %s=> %p %s %v tc=%d type=%#L\n", pos, indent, n, op, n, tc, typ)
}
}