mirror of
https://github.com/golang/go
synced 2024-11-23 16:30:06 -07:00
0b6a10ef24
dowidth is fundamentally unsafe to call from the back end; it will cause data races. Replace all calls to dowidth in the backend with assertions that the width has been calculated. Then fix all the cases in which that was not so, including the cases from #20145. Fixes #20145. Change-Id: Idba3d19d75638851a30ec2ebcdb703c19da3e92b Reviewed-on: https://go-review.googlesource.com/41970 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
15 lines
321 B
Go
15 lines
321 B
Go
// compile
|
|
|
|
// Copyright 2017 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// Issue 20145: some func types weren't dowidth-ed by the front end,
|
|
// leading to races in the backend.
|
|
|
|
package p
|
|
|
|
func f() {
|
|
_ = (func())(nil)
|
|
}
|