Commit 4e64ee42 authored by Matthew Dempsky's avatar Matthew Dempsky

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: 's avatarAustin Clements <austin@google.com>
parent 5c18a3ca
......@@ -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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment