]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: plan9 - mark gbit16 as go:nosplit
authorRichard Miller <miller.research@gmail.com>
Sat, 28 May 2016 09:06:37 +0000 (10:06 +0100)
committerDavid du Colombier <0intro@gmail.com>
Tue, 31 May 2016 04:53:19 +0000 (04:53 +0000)
This is a correction to CL 22610.  The gbit16 function is called in
StartProcess between fork and exec, and therefore must not split the
stack.  Normally it's inlined so this is not an issue, but on one
occasion I've observed it to be compiled without inlining, and the
result was a panic.  Mark it go:nosplit to be safe.

Change-Id: I0381754397b766431bf406d9767c73598d23b901
Reviewed-on: https://go-review.googlesource.com/23560
Reviewed-by: David du Colombier <0intro@gmail.com>
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/syscall/dir_plan9.go

index 697bf5499c35c04e667e89a00d2e5a2d54a70e94..15b267411cbfcf320a207f1331669c168187ae43 100644 (file)
@@ -184,6 +184,7 @@ func gbit8(b []byte) (uint8, []byte) {
 }
 
 // gbit16 reads a 16-bit number in little-endian order from b and returns it with the remaining slice of b.
+//go:nosplit
 func gbit16(b []byte) (uint16, []byte) {
        return uint16(b[0]) | uint16(b[1])<<8, b[2:]
 }