]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: omit write barrier when assigning global function
authorAustin Clements <austin@google.com>
Wed, 16 Mar 2016 22:22:58 +0000 (18:22 -0400)
committerAustin Clements <austin@google.com>
Wed, 16 Mar 2016 22:42:45 +0000 (22:42 +0000)
commit3e54ca9a4624fda0bcd76192aa529e826ef12b4f
tree6a36221aef31071d3b57f24c5832c9d4e94fc170
parent4e75932cf7148c6ed10f93bbc07a79a7f89e8bd2
cmd/compile: omit write barrier when assigning global function

Currently we generate write barriers when the right side of an
assignment is a global function. This doesn't fall into the existing
case of storing an address of a global because we haven't lowered the
function to a pointer yet.

This write barrier is unnecessary, so eliminate it.

Fixes #13901.

Change-Id: Ibc10e00a8803db0fd75224b66ab94c3737842a79
Reviewed-on: https://go-review.googlesource.com/20772
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/walk.go
test/writebarrier.go