summaryrefslogtreecommitdiff
path: root/src/cmd/gc/const.c
diff options
context:
space:
mode:
authorKen Thompson <ken@golang.org>2008-07-20 20:13:07 -0700
committerKen Thompson <ken@golang.org>2008-07-20 20:13:07 -0700
commit5d8928e80b5a38b343f9867d7a13c40917526fcf (patch)
tree318493dc62158eeaf2f74116d95aab053e529794 /src/cmd/gc/const.c
parentb031b4aea4ffd19162878d291696bcd79adf841a (diff)
downloadgolang-5d8928e80b5a38b343f9867d7a13c40917526fcf.tar.gz
start of select
random bugs fixed SVN=128149
Diffstat (limited to 'src/cmd/gc/const.c')
-rw-r--r--src/cmd/gc/const.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/cmd/gc/const.c b/src/cmd/gc/const.c
index 12a7ef83b..1d8b921c6 100644
--- a/src/cmd/gc/const.c
+++ b/src/cmd/gc/const.c
@@ -20,9 +20,13 @@ convlit(Node *n, Type *t)
goto bad1;
case Wlitnil:
- if(isptr[et] || et == TINTER)
- break;
- goto bad1;
+ if(!isptr[et] && et != TINTER)
+ goto bad1;
+ if(isptrto(t, TSTRING)) {
+ n->val.sval = mal(8);
+ n->val.ctype = CTSTR;
+ }
+ break;
case Wlitstr:
if(isptrto(t, TSTRING))