diff options
Diffstat (limited to 'src/cmd/compile/internal/noder')
| -rw-r--r-- | src/cmd/compile/internal/noder/unified.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/noder/unified.go b/src/cmd/compile/internal/noder/unified.go index 6c4ac66e3d..0afa505550 100644 --- a/src/cmd/compile/internal/noder/unified.go +++ b/src/cmd/compile/internal/noder/unified.go @@ -118,6 +118,16 @@ func unified(m posMap, noders []*noder) { } } + // For functions originally came from package runtime, + // mark as norace to prevent instrumenting, see issue #60439. + for _, n := range target.Decls { + if fn, ok := n.(*ir.Func); ok { + if !base.Flag.CompilingRuntime && types.IsRuntimePkg(fn.Sym().Pkg) { + fn.Pragma |= ir.Norace + } + } + } + base.ExitIfErrors() // just in case } |
