From: Russ Cox Date: Mon, 13 Dec 2010 18:42:51 +0000 (-0500) Subject: gc: another shift bug X-Git-Tag: weekly.2010-12-15~44 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=603f9feeecccd70886f6096d7427cfccf794d3de;p=gostls13.git gc: another shift bug Fixes #1316. R=ken2 CC=golang-dev https://golang.org/cl/3575042 --- diff --git a/src/cmd/gc/const.c b/src/cmd/gc/const.c index a3405e078c..5a7c548942 100644 --- a/src/cmd/gc/const.c +++ b/src/cmd/gc/const.c @@ -101,7 +101,7 @@ convlit1(Node **np, Type *t, int explicit) break; case OLSH: case ORSH: - convlit1(&n->left, t, explicit); + convlit1(&n->left, t, explicit && isideal(n->left->type)); t = n->left->type; if(t != T && !isint[t->etype]) { yyerror("invalid operation: %#N (shift of type %T)", n, t); diff --git a/test/const3.go b/test/const3.go index dd5c88958d..9bba6ced0b 100644 --- a/test/const3.go +++ b/test/const3.go @@ -26,4 +26,10 @@ func main() { println("type info didn't propagate in const: got", s) panic("fail") } + x := uint(5) + y := float64(uint64(1)<