]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix build for Linux/ARM
authorShenghou Ma <minux.ma@gmail.com>
Fri, 8 Feb 2013 05:24:38 +0000 (13:24 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Fri, 8 Feb 2013 05:24:38 +0000 (13:24 +0800)
R=dave, rsc
CC=golang-dev
https://golang.org/cl/7299055

src/pkg/runtime/traceback_arm.c

index 39dc6fd22cec438a4734e0dffd12abe907590d11..e44e0f82fdd7b56073da4511cbb1f6a6dc86846f 100644 (file)
@@ -183,10 +183,15 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *gp, int32 skip, uintptr
                if(f->entry == (uintptr)runtime·deferproc || f->entry == (uintptr)runtime·newproc)
                        sp += 12;
 
-               // sighandler saves the lr on stack before fake a call to sigpanic
+               // sighandler saves the lr on stack before faking a call to sigpanic
                if(waspanic) {
-                       pc = *(uintptr *)sp;
+                       x = *(uintptr *)sp;
                        sp += 4;
+                       f = runtime·findfunc(pc);
+                       if (f == nil) {
+                               pc = x;
+                       } else if (f->frame == 0)
+                               lr = x;
                }
        }