]> Cypherpunks repositories - gostls13.git/commitdiff
gc: print x[y:] correctly
authorRuss Cox <rsc@golang.org>
Wed, 21 Apr 2010 00:39:31 +0000 (17:39 -0700)
committerRuss Cox <rsc@golang.org>
Wed, 21 Apr 2010 00:39:31 +0000 (17:39 -0700)
R=ken2
CC=golang-dev
https://golang.org/cl/955041

src/cmd/gc/print.c

index f9799c5231c8b0eb829793ef120e18e6f65993da..8d85d04652968eb678ab419b66c2545a88264b7a 100644 (file)
@@ -297,7 +297,8 @@ exprfmt(Fmt *f, Node *n, int prec)
                fmtprint(f, "[");
                exprfmt(f, n->right->left, 0);
                fmtprint(f, ":");
-               exprfmt(f, n->right->right, 0);
+               if(n->right->right != N)
+                       exprfmt(f, n->right->right, 0);
                fmtprint(f, "]");
                break;