summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKen Thompson <ken@golang.org>2008-06-17 18:01:05 -0700
committerKen Thompson <ken@golang.org>2008-06-17 18:01:05 -0700
commitafde166dabc0a0108c47a3f3cdd6b870a6a598cb (patch)
treec98f6ab3c9c42a0a2061016e72e5255a20d3a334 /src
parent122e88d30c58626e6c27ce5eac4278dcf1744a9d (diff)
downloadgolang-afde166dabc0a0108c47a3f3cdd6b870a6a598cb.tar.gz
SVN=123249
Diffstat (limited to 'src')
-rw-r--r--src/cmd/gc/const.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/cmd/gc/const.c b/src/cmd/gc/const.c
index 0a530b47d..589066a9b 100644
--- a/src/cmd/gc/const.c
+++ b/src/cmd/gc/const.c
@@ -9,17 +9,21 @@ void
convlit(Node *n, Type *t)
{
int et;
+ Node *n1;
if(n == N || n->op != OLITERAL || t == T)
return;
- if(t->etype == TANY || isptrto(t, TANY)) {
- defaultlit(n);
- return;
- }
-
et = t->etype;
switch(whatis(n)) {
+ default:
+ goto bad1;
+
+ case Wlitnil:
+ if(isptr[et] || et = TINTER)
+ break;
+ goto bad1;
+
case Wlitint:
if(isptrto(t, TSTRING)) {
Rune rune;