Commit 24838a2d authored by Rob Pike's avatar Rob Pike

fix bug in stack limit calculation - was setting limit reg in wrong place.

R=ken
OCL=14981
CL=14981
parent ffbccb66
......@@ -463,8 +463,6 @@ oldstack(void)
top = (Stktop*)m->curg->stackbase;
m->curg->stackbase = top->oldbase;
m->curg->stackguard = top->oldguard;
siz2 = (top->magic>>32) & 0xffffLL;
sp = (byte*)top;
......@@ -474,15 +472,12 @@ oldstack(void)
mcpy(top->oldsp+16, sp, siz2);
}
// call no more functions after this point - limit register disagrees with R15
m->curg->stackbase = top->oldbase;
m->curg->stackguard = top->oldguard;
m->morestack.SP = top->oldsp+8;
m->morestack.PC = (byte*)(*(uint64*)(top->oldsp+8));
// prints("oldstack sp=");
// sys·printpointer(m->morestack.SP);
// prints(" pc=");
// sys·printpointer(m->morestack.PC);
// prints("\n");
gogoret(&m->morestack, m->cret);
}
......
......@@ -81,6 +81,7 @@ TEXT sigtramp(SB),7,$24-16
TEXT sys·mmap(SB),7,$0-32
MOVQ 8(SP), DI
MOVQ $0, SI
MOVL 16(SP), SI
MOVL 20(SP), DX
MOVL 24(SP), R10
......@@ -103,7 +104,7 @@ TEXT sys·mmap(SB),7,$0-32
RET
TEXT notok(SB),7,$0
MOVL $0xf1, BP
MOVQ $0xf1, BP
MOVQ BP, (BP)
RET
......
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