mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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
This commit is contained in:
parent
4eb17ecd1f
commit
f0d73fbc7c
4 changed files with 18 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue