]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: don't let select split stack
authorRuss Cox <rsc@golang.org>
Wed, 20 Oct 2010 19:54:17 +0000 (15:54 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 20 Oct 2010 19:54:17 +0000 (15:54 -0400)
Fixes #1209.

R=ken2
CC=golang-dev
https://golang.org/cl/2612041

src/pkg/runtime/chan.c

index 436f8b1401b6cac3bdf1220f13ff24b99784847d..d01159923fea6f6c5d4c557b23fc0768b8f89bfe 100644 (file)
@@ -620,6 +620,12 @@ selunlock(Select *sel)
 }
 
 // selectgo(sel *byte);
+//
+// overwrites return pc on stack to signal which case of the select
+// to run, so cannot appear at the top of a split stack.
+// frame has 6 pointers and 4 int32 so 64 bytes max.
+// that's less than StackGuard-StackSmall, so okay.
+#pragma textflag 7
 void
 ·selectgo(Select *sel)
 {