]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: clear up lr comments
authorRuss Cox <rsc@golang.org>
Tue, 29 Jan 2013 21:12:50 +0000 (13:12 -0800)
committerRuss Cox <rsc@golang.org>
Tue, 29 Jan 2013 21:12:50 +0000 (13:12 -0800)
R=cshapiro
CC=golang-dev
https://golang.org/cl/7230052

src/pkg/runtime/traceback_arm.c
src/pkg/runtime/traceback_x86.c

index da7ab570ca2c0c7db4dbb02cc845ab5f8be0cc7b..6082f6acd0d1ede770f3a9b4cd41137908693832 100644 (file)
@@ -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;
        }
index e235757b0f5c831df425e65f99aaca6908012e0f..180accb10d7dd90a43d6557182e0cc357331c45e 100644 (file)
@@ -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) {