From: Russ Cox Date: Tue, 29 Jan 2013 21:12:50 +0000 (-0800) Subject: runtime: clear up lr comments X-Git-Tag: go1.1rc2~1260 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ec1948a44d93b76692188df3a9d1dc45c8ee390e;p=gostls13.git runtime: clear up lr comments R=cshapiro CC=golang-dev https://golang.org/cl/7230052 --- diff --git a/src/pkg/runtime/traceback_arm.c b/src/pkg/runtime/traceback_arm.c index da7ab570ca..6082f6acd0 100644 --- a/src/pkg/runtime/traceback_arm.c +++ b/src/pkg/runtime/traceback_arm.c @@ -32,7 +32,7 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *gp, int32 skip, uintptr waspanic = false; // If the PC is goexit, the goroutine hasn't started yet. - if(pc == (uintptr)runtime·goexit) { + if(pc == (uintptr)runtime·goexit && gp->entry != 0) { pc = (uintptr)gp->entry; lr = (uintptr)runtime·goexit; } diff --git a/src/pkg/runtime/traceback_x86.c b/src/pkg/runtime/traceback_x86.c index e235757b0f..180accb10d 100644 --- a/src/pkg/runtime/traceback_x86.c +++ b/src/pkg/runtime/traceback_x86.c @@ -40,19 +40,12 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *gp, int32 skip, uintptr waspanic = false; // If the PC is goexit, the goroutine hasn't started yet. - if(pc0 == gp->sched.pc && sp == (byte*)gp->sched.sp && pc0 == (byte*)runtime·goexit) { + if(pc0 == gp->sched.pc && sp == (byte*)gp->sched.sp && pc0 == (byte*)runtime·goexit && gp->entry != 0) { fp = sp; lr = pc; pc = (uintptr)gp->entry; } - // If the PC is zero, it's likely a nil function call. - // Start in the caller's frame. - if(pc == 0) { - pc = lr; - lr = 0; - } - // If the PC is zero, it's likely a nil function call. // Start in the caller's frame. if(pc == 0) {