]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix unwindstack crash
authorRuss Cox <rsc@golang.org>
Fri, 24 Sep 2010 03:04:32 +0000 (23:04 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 24 Sep 2010 03:04:32 +0000 (23:04 -0400)
Bug and fix identified by Alexey Gokhberg.
Fixes #1135.

R=r, brainman
CC=golang-dev
https://golang.org/cl/2198046

src/pkg/runtime/proc.c

index 1d1b05969c6ee73fc67a013361c58f6e6c334623..9483e4c2904c2a5db7e43cd4f446dbfa6fa2be07 100644 (file)
@@ -956,7 +956,8 @@ unwindstack(G *gp, byte *sp)
                        break;
                gp->stackbase = top->stackbase;
                gp->stackguard = top->stackguard;
-               free(stk);
+               if(top->free)
+                       stackfree(stk);
        }
 
        if(sp != nil && (sp < gp->stackguard - StackGuard || gp->stackbase < sp)) {