mirror of
https://github.com/golang/go
synced 2024-09-15 22:20:06 +00:00
cmd/compile: restore zero assignment optimization for non-pointer types
golang.org/cl/31572 disabled some write barrier optimizations, but inadvertantly disabled optimizations for some non-pointer composite literal assignments too. Fixes #18370. Change-Id: Ia25019bd3016b6ab58173298c7d16202676bce6b Reviewed-on: https://go-review.googlesource.com/34564 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
12979345b1
commit
75d367e34b
|
@ -694,6 +694,10 @@ opswitch:
|
|||
break
|
||||
}
|
||||
|
||||
if !instrumenting && iszero(n.Right) && !needwritebarrier(n.Left, n.Right) {
|
||||
break
|
||||
}
|
||||
|
||||
switch n.Right.Op {
|
||||
default:
|
||||
n.Right = walkexpr(n.Right, init)
|
||||
|
|
Loading…
Reference in a new issue