Commit 9fbfe7cc authored by David Lazar's avatar David Lazar

cmd/compile: do not inline functions marked cgo_unsafe_args

Now the net tests pass with -gcflags '-l=4'.

Fixes #18125.

Change-Id: I4e3a46eb0cb3a93b203e74f5bc99c5822331f535
Reviewed-on: https://go-review.googlesource.com/33722Reviewed-by: default avatarKeith Randall <khr@golang.org>
parent 3c2e4ed8
......@@ -107,6 +107,12 @@ func caninl(fn *Node) {
return
}
// If marked "go:cgo_unsafe_args", don't inline
if fn.Func.Pragma&CgoUnsafeArgs != 0 {
reason = "marked go:cgo_unsafe_args"
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