]> 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>
Tue, 28 Mar 2017 18:06:36 +0000 (18:06 +0000)
commit8ee2d5bc00c5cc2313d87e001961294907cee133
treeb5970e8650e7dba23f086173844f6cc6d8e7a300
parent8dafdb1be147f0cd5a2811c69ce6e27769f5e5f1
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.

This is a re-roll of CL 38469.

Change-Id: Ic5b4baa250618504611fc57cbf51ab01d1eddf80
Reviewed-on: https://go-review.googlesource.com/38534
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/closure.go
src/cmd/compile/internal/gc/type.go