From 2da9783e2b79f0c9a05087ba014bb93d03e191ea Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Sat, 12 Jul 2008 11:30:53 -0700 Subject: preserve AX across stack jump so C routines return correct value when triggering morestack. SVN=126935 --- src/runtime/rt2_amd64.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/runtime/rt2_amd64.c') diff --git a/src/runtime/rt2_amd64.c b/src/runtime/rt2_amd64.c index dac1c4684a..a5f5d109a9 100644 --- a/src/runtime/rt2_amd64.c +++ b/src/runtime/rt2_amd64.c @@ -8,8 +8,6 @@ extern int32 debug; static int8 spmark[] = "\xa7\xf1\xd9\x2a\x82\xc8\xd8\xfe"; -extern void morestack2(); - void traceback(uint8 *pc, uint8 *sp, void* r15) { @@ -29,8 +27,8 @@ traceback(uint8 *pc, uint8 *sp, void* r15) name = "panic"; for(;;){ callpc = pc; - if((uint8*)morestack2 == pc) { - // call site is morestack2(); pop to earlier stack block to get true caller + if((uint8*)retfromnewstack == pc) { + // call site is retfromnewstack(); pop to earlier stack block to get true caller stktop = (Stktop*)g.stackbase; g.stackbase = stktop->oldbase; g.stackguard = stktop->oldguard; -- cgit v1.3