aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/gc
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/gc')
-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;