1
0
mirror of https://github.com/golang/go synced 2024-11-23 06:00:08 -07:00

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
This commit is contained in:
Russ Cox 2014-03-11 23:58:11 -04:00
parent 5b5c8f0576
commit ab844022ee

View 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]);