]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: dowidth more in the front end
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 27 Apr 2017 16:27:52 +0000 (09:27 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 27 Apr 2017 22:10:32 +0000 (22:10 +0000)
commit0b6a10ef246ff55085d6ec88f68f5fd96677b141
treef6686f3edeeb103bf84e02fc28c2c00e47a1b7ca
parentbe2ee2a4b46d1dbaf8d455038cd12d883714f08d
cmd/compile: dowidth more in the front end

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>
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/gc/typecheck.go
src/cmd/compile/internal/gc/walk.go
src/cmd/compile/internal/types/type.go
test/fixedbugs/issue20145.go [new file with mode: 0644]