]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: strengthen SetFields/Width safety guarantee
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 23 Mar 2017 18:40:47 +0000 (11:40 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 23 Mar 2017 19:16:27 +0000 (19:16 +0000)
commitb1b4f67169c5ceb3c81ba900c5022722d28755ab
tree13c33bfa41bbe476b3c966dcebf77fb91167c183
parent7ac2e413ebc42cb2e8cac73f72a679b60f9c906b
cmd/compile: strengthen SetFields/Width safety guarantee

It is currently possible in the compiler to create a struct type,
calculate the widths of types that depend on it,
and then alter the struct type.

transformclosure has local protection against this.
Protect against it at a deeper level.

This is preparation to call dowidth automatically,
rather than explicitly.

Change-Id: Ic1578ca014610197cfe54a9f4d044d122a7217e8
Reviewed-on: https://go-review.googlesource.com/38469
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/closure.go
src/cmd/compile/internal/gc/type.go