aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/gc/walk.c
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2014-10-27 17:17:06 -0400
committerAustin Clements <austin@google.com>2014-10-27 17:17:06 -0400
commit5a653089ef756ecda170e4ee030480d547496362 (patch)
treefe2c3550eb05fe487b5870dfef3d06972582c1a9 /src/cmd/gc/walk.c
parent32c75a2d3d121f31ace325d48d9fcbdde58cc042 (diff)
parent3e62d2184ab2d2ac6053e3f4af5e3f99902c1e32 (diff)
downloadgo-5a653089ef756ecda170e4ee030480d547496362.tar.xz
[dev.power64] all: merge default into dev.power64
LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/164110043
Diffstat (limited to 'src/cmd/gc/walk.c')
-rw-r--r--src/cmd/gc/walk.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/cmd/gc/walk.c b/src/cmd/gc/walk.c
index 2520343bfd..eaa0440552 100644
--- a/src/cmd/gc/walk.c
+++ b/src/cmd/gc/walk.c
@@ -614,7 +614,7 @@ walkexpr(Node **np, NodeList **init)
if(oaslit(n, init))
goto ret;
- if(n->right == N)
+ if(n->right == N || iszero(n->right) && !flag_race)
goto ret;
switch(n->right->op) {
@@ -1390,12 +1390,6 @@ walkexpr(Node **np, NodeList **init)
case OMAPLIT:
case OSTRUCTLIT:
case OPTRLIT:
- // NOTE(rsc): Race detector cannot handle seeing
- // a STRUCTLIT or ARRAYLIT representing a zero value,
- // so make a temporary for those always in race mode.
- // Otherwise, leave zero values in place.
- if(iszero(n) && !flag_race)
- goto ret;
var = temp(n->type);
anylit(0, n, var, init);
n = var;