Commit ab844022 authored by Russ Cox's avatar Russ Cox

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
parent 5b5c8f05
......@@ -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]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment