A recent commit lost the branch target in the really-big-stack
case of splitstack, causing an infinite loop stack preempt
case. Revive the branch target.
LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/
157790044
static Prog*
stacksplit(Link *ctxt, Prog *p, int32 framesize, int noctxt)
{
- Prog *q1;
+ Prog *q, *q1;
// MOVD g_stackguard(g), R3
p = appendp(ctxt, p);
p->to.type = D_REG;
p->to.reg = 3;
+ q = nil;
if(framesize <= StackSmall) {
// small stack: SP < stackguard
// CMP stackguard, SP
p->to.type = D_CONST;
p->to.offset = StackPreempt;
- p = appendp(ctxt, p);
+ q = p = appendp(ctxt, p);
p->as = ABEQ;
p->to.type = D_BRANCH;
p->from.offset = D_LR;
p->to.type = D_REG;
p->to.reg = 5;
+ if(q)
+ q->pcond = p;
// BL runtime.morestack(SB)
p = appendp(ctxt, p);