From: Austin Clements Date: Thu, 9 Feb 2017 22:08:27 +0000 (-0500) Subject: cmd/compile: disallow combining nosplit and systemstack X-Git-Tag: go1.9beta1~1641 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=450472989b318b7242d2c3d0db4c09d84727c065;p=gostls13.git 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 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- diff --git a/src/cmd/compile/internal/gc/pgen.go b/src/cmd/compile/internal/gc/pgen.go index 5ec253667b..1acbbf3b1e 100644 --- a/src/cmd/compile/internal/gc/pgen.go +++ b/src/cmd/compile/internal/gc/pgen.go @@ -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.