summaryrefslogtreecommitdiff
path: root/src/cmd/gc/const.c
diff options
context:
space:
mode:
authorKen Thompson <ken@golang.org>2008-08-29 13:24:53 -0700
committerKen Thompson <ken@golang.org>2008-08-29 13:24:53 -0700
commit21ef207889122448cf008accb688b118d987da79 (patch)
tree04aa70c53d846411240c1d6ba0022d85a7cc7c21 /src/cmd/gc/const.c
parent2f183469b29f28ec7bfac4f9c75664f3f4d7f5a0 (diff)
downloadgolang-21ef207889122448cf008accb688b118d987da79.tar.gz
fix type of (1<<x)
R=r OCL=14656 CL=14656
Diffstat (limited to 'src/cmd/gc/const.c')
-rw-r--r--src/cmd/gc/const.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/cmd/gc/const.c b/src/cmd/gc/const.c
index 90eaff269..f8c6acbc0 100644
--- a/src/cmd/gc/const.c
+++ b/src/cmd/gc/const.c
@@ -11,9 +11,19 @@ convlit(Node *n, Type *t)
int et;
Node *n1;
- if(n == N || n->op != OLITERAL || t == T)
+ if(n == N || t == T)
return;
-
+ switch(n->op) {
+ default:
+ return;
+ case OLITERAL:
+ break;
+ case OLSH:
+ case ORSH:
+ convlit(n->left, t);
+ n->type = n->left->type;
+ return;
+ }
et = t->etype;
switch(whatis(n)) {
default: