1
0
mirror of https://github.com/golang/go synced 2024-11-19 00:14:39 -07:00

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

R=ken
OCL=14981
CL=14981
This commit is contained in:
Rob Pike 2008-09-08 19:30:14 -07:00
parent ffbccb66c2
commit 24838a2df6
2 changed files with 5 additions and 9 deletions

View File

@ -463,8 +463,6 @@ oldstack(void)
top = (Stktop*)m->curg->stackbase; top = (Stktop*)m->curg->stackbase;
m->curg->stackbase = top->oldbase;
m->curg->stackguard = top->oldguard;
siz2 = (top->magic>>32) & 0xffffLL; siz2 = (top->magic>>32) & 0xffffLL;
sp = (byte*)top; sp = (byte*)top;
@ -474,15 +472,12 @@ oldstack(void)
mcpy(top->oldsp+16, sp, siz2); 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.SP = top->oldsp+8;
m->morestack.PC = (byte*)(*(uint64*)(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); gogoret(&m->morestack, m->cret);
} }

View File

@ -81,6 +81,7 @@ TEXT sigtramp(SB),7,$24-16
TEXT sys·mmap(SB),7,$0-32 TEXT sys·mmap(SB),7,$0-32
MOVQ 8(SP), DI MOVQ 8(SP), DI
MOVQ $0, SI
MOVL 16(SP), SI MOVL 16(SP), SI
MOVL 20(SP), DX MOVL 20(SP), DX
MOVL 24(SP), R10 MOVL 24(SP), R10
@ -103,7 +104,7 @@ TEXT sys·mmap(SB),7,$0-32
RET RET
TEXT notok(SB),7,$0 TEXT notok(SB),7,$0
MOVL $0xf1, BP MOVQ $0xf1, BP
MOVQ BP, (BP) MOVQ BP, (BP)
RET RET