Commit 45047298 authored by Austin Clements's avatar Austin Clements

cmd/compile: disallow combining nosplit and systemstack

go:systemstack works by tweaking the stack check prologue to check
against a different bound, while go:nosplit removes the stack check
prologue entirely. Hence, they can't be used together. Make the build
fail if they are.

Change-Id: I2d180c4b1d31ff49ec193291ecdd42921d253359
Reviewed-on: https://go-review.googlesource.com/36710
Run-TryBot: Austin Clements <austin@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 23df5274
......@@ -397,6 +397,9 @@ func compile(fn *Node) {
}
if fn.Func.Pragma&Systemstack != 0 {
ptxt.From.Sym.Set(obj.AttrCFunc, true)
if fn.Func.Pragma&Nosplit != 0 {
yyerror("go:nosplit and go:systemstack cannot be combined")
}
}
// Clumsy but important.
......
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