Message ID | mcripjen0n6.fsf@dhcp-172-18-216-180.mtv.corp.google.com |
---|---|
State | New |
Headers | show |
diff -r 971ec6345e64 libgo/runtime/proc.c --- a/libgo/runtime/proc.c Fri Feb 10 07:50:54 2012 -0800 +++ b/libgo/runtime/proc.c Fri Feb 10 07:52:48 2012 -0800 @@ -909,7 +909,9 @@ __splitstack_getcontext(&g->stack_context[0]); #else 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 = ∓ #endif getcontext(&g->context); @@ -1267,6 +1269,8 @@ #else sp = newg->gcinitial_sp; spsize = newg->gcstack_size; + if(spsize == 0) + runtime_throw("bad spsize in __go_go"); newg->gcnext_sp = sp; #endif } else {