From: Russ Cox Date: Wed, 12 Mar 2014 03:58:11 +0000 (-0400) Subject: cmd/gc: fix crash in -live mode X-Git-Tag: go1.3beta1~390 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ab844022eeedc6c16d0cdb7fb6fee01dd9e6307a;p=gostls13.git cmd/gc: fix crash in -live mode 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 --- diff --git a/src/cmd/gc/plive.c b/src/cmd/gc/plive.c index 4a72e612e2..a6a1d48d79 100644 --- a/src/cmd/gc/plive.c +++ b/src/cmd/gc/plive.c @@ -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