1
0
mirror of https://github.com/golang/go synced 2024-11-12 05:30:21 -07:00

cmd/internal/gc: fix race build (again)

Add OGETG to the list of ignored operations.

We don't instrument the runtime package, but calls to runtime.getg
can appear in other packages, for example, after inlining
runtime.LockOSThread.

Change-Id: I8d6e91f1f3c8fd1302b596bdead42d588c059911
Reviewed-on: https://go-review.googlesource.com/8553
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
This commit is contained in:
Dave Cheney 2015-04-08 02:01:55 +10:00
parent d6b4069852
commit d3252a2db9

View File

@ -410,9 +410,6 @@ func racewalknode(np **Node, init **NodeList, wr int, skip int) {
OLABEL:
goto ret
case OGETG:
Yyerror("racewalk: OGETG can happen only in runtime which we don't instrument")
// does not require instrumentation
case OPRINT, // don't bother instrumenting it
OPRINTN, // don't bother instrumenting it
@ -428,6 +425,11 @@ func racewalknode(np **Node, init **NodeList, wr int, skip int) {
ONONAME,
OLITERAL,
OSLICESTR,
// g is goroutine local so cannot race. Although we don't instrument
// the runtime package, through inlining the call to runtime.getg can
// appear in non runtime packages, for example, after inlining
// runtime.LockOSThread.
OGETG,
// always preceded by bounds checking, avoid double instrumentation.
OTYPESW: // ignored by code generation, do not instrument.
goto ret