From f0d73fbc7c24ea9d81f24732896a99778f623f80 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 27 Jun 2013 16:51:06 -0400 Subject: runtime: use gp->sched.sp for stack overflow check On x86 it is a few words lower on the stack than m->morebuf.sp so it is a more precise check. Enabling the check requires recording a valid gp->sched in reflect.call too. This is a good thing in general, since it will make stack traces during reflect.call work better, and it may be useful for preemption too. R=dvyukov CC=golang-dev https://golang.org/cl/10709043 --- src/pkg/runtime/stack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pkg/runtime/stack.c') diff --git a/src/pkg/runtime/stack.c b/src/pkg/runtime/stack.c index 5480c46970..16dfa041a0 100644 --- a/src/pkg/runtime/stack.c +++ b/src/pkg/runtime/stack.c @@ -215,7 +215,7 @@ runtime·newstack(void) if(!reflectcall) runtime·rewindmorestack(&gp->sched); - sp = m->morebuf.sp; + sp = gp->sched.sp; if(thechar == '6' || thechar == '8') { // The call to morestack cost a word. sp -= sizeof(uintptr); -- cgit v1.3