Commit d3229873 by Ian Lance Taylor

runtime: For g0 set stack_size to 0 when not -fsplit-stack.

From-SVN: r184099
parent c91e2490
...@@ -909,7 +909,9 @@ runtime_mstart(void* mp) ...@@ -909,7 +909,9 @@ runtime_mstart(void* mp)
__splitstack_getcontext(&g->stack_context[0]); __splitstack_getcontext(&g->stack_context[0]);
#else #else
g->gcinitial_sp = ∓ g->gcinitial_sp = ∓
g->gcstack_size = StackMin; // Setting gcstack_size to 0 is a marker meaning that gcinitial_sp
// is the top of the stack, not the bottom.
g->gcstack_size = 0;
g->gcnext_sp = ∓ g->gcnext_sp = ∓
#endif #endif
getcontext(&g->context); getcontext(&g->context);
...@@ -1267,6 +1269,8 @@ __go_go(void (*fn)(void*), void* arg) ...@@ -1267,6 +1269,8 @@ __go_go(void (*fn)(void*), void* arg)
#else #else
sp = newg->gcinitial_sp; sp = newg->gcinitial_sp;
spsize = newg->gcstack_size; spsize = newg->gcstack_size;
if(spsize == 0)
runtime_throw("bad spsize in __go_go");
newg->gcnext_sp = sp; newg->gcnext_sp = sp;
#endif #endif
} else { } else {
......
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