Commit 8e6e9e83 authored by Richard Miller's avatar Richard Miller Committed by David du Colombier

syscall: plan9 - mark gbit16 as go:nosplit

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/23560Reviewed-by: default avatarDavid du Colombier <0intro@gmail.com>
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarMinux Ma <minux@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent b3f98d7a
...@@ -184,6 +184,7 @@ func gbit8(b []byte) (uint8, []byte) { ...@@ -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. // 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) { func gbit16(b []byte) (uint16, []byte) {
return uint16(b[0]) | uint16(b[1])<<8, b[2:] return uint16(b[0]) | uint16(b[1])<<8, b[2:]
} }
......
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