]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gc: fix crash in -live mode
authorRuss Cox <rsc@golang.org>
Wed, 12 Mar 2014 03:58:11 +0000 (23:58 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 12 Mar 2014 03:58:11 +0000 (23:58 -0400)
debuglive >= 1 is not the condition under which we
start recording messages (we avoid printing for
init functions even if debuglive is set).

LGTM=bradfitz, iant
R=golang-codereviews, bradfitz
CC=golang-codereviews, iant, khr
https://golang.org/cl/74390043

src/cmd/gc/plive.c

index 4a72e612e2206d88025e0e406f8d5b0dc6de0c6f..a6a1d48d7970fa124ec2476d7a35a224bad8737f 100644 (file)
@@ -1607,7 +1607,7 @@ livenessepilogue(Liveness *lv)
                                // We're interpreting the args and locals bitmap instead of liveout so that we
                                // include the bits added by the avarinit logic in the
                                // previous loop.
-                               if(debuglive >= 1) {
+                               if(msg != nil) {
                                        fmtstrinit(&fmt);
                                        fmtprint(&fmt, "%L: live at ", p->lineno);
                                        if(p->as == ACALL && p->to.node)
@@ -1657,7 +1657,7 @@ livenessepilogue(Liveness *lv)
                                pos--;
                        }
                }
-               if(debuglive >= 1) {
+               if(msg != nil) {
                        for(j=startmsg; j<nmsg; j++) 
                                if(msg[j] != nil)
                                        print("%s", msg[j]);