diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2017-10-20 14:20:48 -0700 |
|---|---|---|
| committer | Matthew Dempsky <mdempsky@google.com> | 2017-10-20 22:03:07 +0000 |
| commit | 4e64ee423c3a755ed31c3c98bfba98adc5995b4a (patch) | |
| tree | af6a523a7c39041662920b1e8a153ad25897a301 /src | |
| parent | 5c18a3ca70268c3a85972a4bb40f5dbb0277a27f (diff) | |
| download | go-4e64ee423c3a755ed31c3c98bfba98adc5995b4a.tar.xz | |
cmd/compile: prevent inlining go:yeswritebarrierrec functions
Fixes #22342.
Change-Id: Ic942162e98dce5749e381a31d58b0bf16c7d6f98
Reviewed-on: https://go-review.googlesource.com/72132
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/compile/internal/gc/inl.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/gc/inl.go b/src/cmd/compile/internal/gc/inl.go index f172492128..5772ebe806 100644 --- a/src/cmd/compile/internal/gc/inl.go +++ b/src/cmd/compile/internal/gc/inl.go @@ -117,6 +117,15 @@ func caninl(fn *Node) { return } + // The nowritebarrierrec checker currently works at function + // granularity, so inlining yeswritebarrierrec functions can + // confuse it (#22342). As a workaround, disallow inlining + // them for now. + if fn.Func.Pragma&Yeswritebarrierrec != 0 { + reason = "marked go:yeswritebarrierrec" + return + } + // If fn has no body (is defined outside of Go), cannot inline it. if fn.Nbody.Len() == 0 { reason = "no function body" |
