cmd/compile: add instrumentation of OKEY
Instrument operands of OKEY.
Also instrument OSLICESTR. Previously it was not needed
because of preceeding bounds checks (which were instrumented).
But the preceeding bounds checks have disappeared.
Change-Id: I3b0de213e23cbcf5b8ef800abeded5eeeb3f8287
Reviewed-on: https://go-review.googlesource.com/11417
Reviewed-by: Russ Cox <rsc@golang.org>
diff --git a/src/cmd/compile/internal/gc/racewalk.go b/src/cmd/compile/internal/gc/racewalk.go
index f826097..2664e0c 100644
--- a/src/cmd/compile/internal/gc/racewalk.go
+++ b/src/cmd/compile/internal/gc/racewalk.go
@@ -299,8 +299,14 @@
}
goto ret
- case OSLICE, OSLICEARR, OSLICE3, OSLICE3ARR:
+ case OSLICE, OSLICEARR, OSLICE3, OSLICE3ARR, OSLICESTR:
racewalknode(&n.Left, init, 0, 0)
+ racewalknode(&n.Right, init, 0, 0)
+ goto ret
+
+ case OKEY:
+ racewalknode(&n.Left, init, 0, 0)
+ racewalknode(&n.Right, init, 0, 0)
goto ret
case OADDR:
@@ -413,8 +419,7 @@
OTYPE,
ONONAME,
OLITERAL,
- OSLICESTR, // always preceded by bounds checking, avoid double instrumentation.
- OTYPESW: // ignored by code generation, do not instrument.
+ OTYPESW: // ignored by code generation, do not instrument.
goto ret
}