Skip to content

Commit

Permalink
cmd/compile/internal/gc: allow //go:systemstack only in runtime
Browse files Browse the repository at this point in the history
Fixes golang#12454.

Change-Id: I6406b0119bc4d6c3d1e6f1896b588b7d101448a3
Reviewed-on: https://go-review.googlesource.com/14274
Run-TryBot: Minux Ma <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
  • Loading branch information
minux committed Sep 4, 2015
1 parent e16d803 commit dac87e9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cmd/compile/internal/gc/lex.go
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,9 @@ func getlinepragma() int {
}

if verb == "go:systemstack" {
if compiling_runtime == 0 {
Yyerror("//go:systemstack only allowed in runtime")
}
systemstack = true
return c
}
Expand Down

0 comments on commit dac87e9

Please sign in to comment.