Commit 8ca3372d authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

runtime: fix bad g status after copystack

LGTM=khr
R=khr
CC=golang-codereviews, rsc
https://golang.org/cl/69870054
parent aea99eda
......@@ -1364,6 +1364,8 @@ top:
void
runtime·park(bool(*unlockf)(G*, void*), void *lock, int8 *reason)
{
if(g->status != Grunning)
runtime·throw("bad g status");
m->waitlock = lock;
m->waitunlockf = unlockf;
g->waitreason = reason;
......@@ -1415,6 +1417,8 @@ park0(G *gp)
void
runtime·gosched(void)
{
if(g->status != Grunning)
runtime·throw("bad g status");
runtime·mcall(runtime·gosched0);
}
......@@ -1443,6 +1447,8 @@ runtime·gosched0(G *gp)
void
runtime·goexit(void)
{
if(g->status != Grunning)
runtime·throw("bad g status");
if(raceenabled)
runtime·racegoend();
runtime·mcall(goexit0);
......
......@@ -640,6 +640,7 @@ runtime·newstack(void)
copystack(gp, nframes, newsize);
if(StackDebug >= 1)
runtime·printf("stack grow done\n");
gp->status = oldstatus;
runtime·gogo(&gp->sched);
}
// TODO: if stack is uncopyable because we're in C code, patch return value at
......
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