diff options
| author | Ondřej Surý <ondrej@sury.org> | 2011-06-03 11:31:24 +0200 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2011-06-03 11:38:02 +0200 |
| commit | 13f4fcd5bf09c70942b6c85a2b919ffa1ca0c6a8 (patch) | |
| tree | 717e1ceeef3a60af29e7897c7629d1502b797838 /src/cmd/gc/const.c | |
| parent | 6bf52070ef1028f7fcc98fad1e73795a7efd7ce7 (diff) | |
| download | golang-13f4fcd5bf09c70942b6c85a2b919ffa1ca0c6a8.tar.gz | |
Imported Upstream version 2011.06.02
Diffstat (limited to 'src/cmd/gc/const.c')
| -rw-r--r-- | src/cmd/gc/const.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/gc/const.c b/src/cmd/gc/const.c index a36ec68c0..8fe9072b2 100644 --- a/src/cmd/gc/const.c +++ b/src/cmd/gc/const.c @@ -103,6 +103,8 @@ convlit1(Node **np, Type *t, int explicit) case ORSH: convlit1(&n->left, t, explicit && isideal(n->left->type)); t = n->left->type; + if(t != T && t->etype == TIDEAL && n->val.ctype != CTINT) + n->val = toint(n->val); if(t != T && !isint[t->etype]) { yyerror("invalid operation: %#N (shift of type %T)", n, t); t = T; @@ -514,6 +516,8 @@ evconst(Node *n) n->right = nr; if(nr->type && (issigned[nr->type->etype] || !isint[nr->type->etype])) goto illegal; + nl->val = toint(nl->val); + nr->val = toint(nr->val); break; } |
