diff options
author | Russ Cox <rsc@golang.org> | 2012-02-22 00:29:23 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2012-02-22 00:29:23 -0500 |
commit | 6c7daca23618b97e9f07b05ac8bf072a636fb616 (patch) | |
tree | bcf2c334c416c145f83eb9d01cb1255d491cd2ff | |
parent | 818e3cdb096354dbe1a08581fd432392683529b2 (diff) | |
download | go-6c7daca23618b97e9f07b05ac8bf072a636fb616.tar.gz go-6c7daca23618b97e9f07b05ac8bf072a636fb616.zip |
gc: never crash during a debugging print
TBR=lvd
CC=golang-dev
https://golang.org/cl/5686063
-rw-r--r-- | src/cmd/gc/fmt.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/cmd/gc/fmt.c b/src/cmd/gc/fmt.c index 093b276f07..5672c00103 100644 --- a/src/cmd/gc/fmt.c +++ b/src/cmd/gc/fmt.c @@ -1346,15 +1346,11 @@ nodefmt(Fmt *f, Node *n) Type *t; t = n->type; - if(n->orig == N) { - n->orig = n; - fatal("node with no orig %N", n); - } // we almost always want the original, except in export mode for literals // this saves the importer some work, and avoids us having to redo some // special casing for package unsafe - if(fmtmode != FExp || n->op != OLITERAL) + if((fmtmode != FExp || n->op != OLITERAL) && n->orig != N) n = n->orig; if(f->flags&FmtLong && t != T) { |