diff options
Diffstat (limited to 'src/cmd/gc/const.c')
| -rw-r--r-- | src/cmd/gc/const.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cmd/gc/const.c b/src/cmd/gc/const.c index 36a64cb97..135a8102e 100644 --- a/src/cmd/gc/const.c +++ b/src/cmd/gc/const.c @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +#include <u.h> +#include <libc.h> #include "go.h" #define TUP(x,y) (((x)<<16)|(y)) @@ -1099,7 +1101,7 @@ cmpslit(Node *l, Node *r) int smallintconst(Node *n) { - if(n->op == OLITERAL && n->type != T) + if(n->op == OLITERAL && n->val.ctype == CTINT && n->type != T) switch(simtype[n->type->etype]) { case TINT8: case TUINT8: @@ -1110,6 +1112,7 @@ smallintconst(Node *n) case TBOOL: case TPTR32: return 1; + case TIDEAL: case TINT64: case TUINT64: if(mpcmpfixfix(n->val.u.xval, minintval[TINT32]) < 0 |
