Commit 8bce3b56 authored by Ken Thompson's avatar Ken Thompson

bug127

R=r
OCL=20874
CL=20874
parent 436fcc68
...@@ -67,7 +67,7 @@ convlit(Node *n, Type *t) ...@@ -67,7 +67,7 @@ convlit(Node *n, Type *t)
break; break;
if(et == TINTER) if(et == TINTER)
break; break;
return; goto bad1;
case Wlitstr: case Wlitstr:
if(isnilinter(t)) { if(isnilinter(t)) {
...@@ -212,6 +212,7 @@ evconst(Node *n) ...@@ -212,6 +212,7 @@ evconst(Node *n)
case Wlitfloat: case Wlitfloat:
case Wlitbool: case Wlitbool:
case Wlitstr: case Wlitstr:
case Wlitnil:
break; break;
} }
...@@ -228,6 +229,7 @@ evconst(Node *n) ...@@ -228,6 +229,7 @@ evconst(Node *n)
case Wlitfloat: case Wlitfloat:
case Wlitbool: case Wlitbool:
case Wlitstr: case Wlitstr:
case Wlitnil:
break; break;
} }
...@@ -246,7 +248,7 @@ evconst(Node *n) ...@@ -246,7 +248,7 @@ evconst(Node *n)
nl->val.ctype = CTFLT; nl->val.ctype = CTFLT;
wl = whatis(nl); wl = whatis(nl);
} else { } else {
yyerror("illegal combination of literals %O %E, %E", n->op, wl, wr); yyerror("illegal combination of literals %O %W, %W", n->op, wl, wr);
return; return;
} }
} }
...@@ -264,7 +266,7 @@ evconst(Node *n) ...@@ -264,7 +266,7 @@ evconst(Node *n)
switch(TUP(n->op, wl)) { switch(TUP(n->op, wl)) {
default: default:
yyerror("illegal literal %O %E", n->op, wl); yyerror("illegal literal %O %W", n->op, wl);
return; return;
case TUP(OADD, Wlitint): case TUP(OADD, Wlitint):
...@@ -312,6 +314,11 @@ evconst(Node *n) ...@@ -312,6 +314,11 @@ evconst(Node *n)
mpdivfltflt(fval, nr->val.u.fval); mpdivfltflt(fval, nr->val.u.fval);
break; break;
case TUP(OEQ, Wlitnil):
goto settrue;
case TUP(ONE, Wlitnil):
goto setfalse;
case TUP(OEQ, Wlitint): case TUP(OEQ, Wlitint):
if(mpcmpfixfix(xval, nr->val.u.xval) == 0) if(mpcmpfixfix(xval, nr->val.u.xval) == 0)
goto settrue; goto settrue;
......
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