]> Cypherpunks repositories - gostls13.git/commitdiff
gc: never crash during a debugging print
authorRuss Cox <rsc@golang.org>
Wed, 22 Feb 2012 05:29:23 +0000 (00:29 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 22 Feb 2012 05:29:23 +0000 (00:29 -0500)
TBR=lvd
CC=golang-dev
https://golang.org/cl/5686063

src/cmd/gc/fmt.c

index 093b276f070274747364fab722d95caac725fdee..5672c00103ed3cc41adbba9af49ed55138d54f0a 100644 (file)
@@ -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) {