From ec1948a44d93b76692188df3a9d1dc45c8ee390e Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 29 Jan 2013 13:12:50 -0800 Subject: [PATCH] runtime: clear up lr comments R=cshapiro CC=golang-dev https://golang.org/cl/7230052 --- src/pkg/runtime/traceback_arm.c | 2 +- src/pkg/runtime/traceback_x86.c | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) 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) { -- 2.48.1