]> Cypherpunks repositories - gostls13.git/commitdiff
SVN=123249
authorKen Thompson <ken@golang.org>
Wed, 18 Jun 2008 01:01:05 +0000 (18:01 -0700)
committerKen Thompson <ken@golang.org>
Wed, 18 Jun 2008 01:01:05 +0000 (18:01 -0700)
src/cmd/gc/const.c

index 0a530b47d414a3828af14a30ed441227ba411d6b..589066a9bbf2204477a0aadc80764627916ccaf7 100644 (file)
@@ -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;