Commit 18ee75ec authored by Luuk van Dijk's avatar Luuk van Dijk

gc: handle printing of string/arrayrune conversions

Fixes #2714.

R=rsc
CC=golang-dev
https://golang.org/cl/5540066
parent 436b37d8
...@@ -943,6 +943,7 @@ static int opprec[] = { ...@@ -943,6 +943,7 @@ static int opprec[] = {
[OAPPEND] = 8, [OAPPEND] = 8,
[OARRAYBYTESTR] = 8, [OARRAYBYTESTR] = 8,
[OARRAYLIT] = 8, [OARRAYLIT] = 8,
[OARRAYRUNESTR] = 8,
[OCALLFUNC] = 8, [OCALLFUNC] = 8,
[OCALLINTER] = 8, [OCALLINTER] = 8,
[OCALLMETH] = 8, [OCALLMETH] = 8,
...@@ -969,6 +970,8 @@ static int opprec[] = { ...@@ -969,6 +970,8 @@ static int opprec[] = {
[OPRINT] = 8, [OPRINT] = 8,
[ORECV] = 8, [ORECV] = 8,
[ORUNESTR] = 8, [ORUNESTR] = 8,
[OSTRARRAYBYTE] = 8,
[OSTRARRAYRUNE] = 8,
[OSTRUCTLIT] = 8, [OSTRUCTLIT] = 8,
[OTARRAY] = 8, [OTARRAY] = 8,
[OTCHAN] = 8, [OTCHAN] = 8,
...@@ -1214,7 +1217,9 @@ exprfmt(Fmt *f, Node *n, int prec) ...@@ -1214,7 +1217,9 @@ exprfmt(Fmt *f, Node *n, int prec)
case OCONVIFACE: case OCONVIFACE:
case OCONVNOP: case OCONVNOP:
case OARRAYBYTESTR: case OARRAYBYTESTR:
case OARRAYRUNESTR:
case OSTRARRAYBYTE: case OSTRARRAYBYTE:
case OSTRARRAYRUNE:
case ORUNESTR: case ORUNESTR:
if(n->type == T || n->type->sym == S) if(n->type == T || n->type->sym == S)
return fmtprint(f, "(%T)(%N)", n->type, n->left); return fmtprint(f, "(%T)(%N)", n->type, n->left);
...@@ -1372,7 +1377,8 @@ nodedump(Fmt *fp, Node *n) ...@@ -1372,7 +1377,8 @@ nodedump(Fmt *fp, Node *n)
indent(fp); indent(fp);
} }
} }
fmtprint(fp, "[%p]", n);
// fmtprint(fp, "[%p]", n);
switch(n->op) { switch(n->op) {
default: default:
......
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