]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: allow huge rsh in constants arithmetic
authorAlberto Donizetti <alb.donizetti@gmail.com>
Thu, 20 Aug 2015 15:53:41 +0000 (17:53 +0200)
committerRobert Griesemer <gri@golang.org>
Fri, 21 Aug 2015 20:27:22 +0000 (20:27 +0000)
commit85de30e72f62c41f21eb1eb2c8ad4a05a163c9c1
tree775fc4eda1597493ea1bbfdd8181d5d7d19ab4e7
parent548041ed08a1f006e4cdac62f2b3bf4adf99f894
cmd/compile: allow huge rsh in constants arithmetic

Currently an expression like

var v = 0 >> 1000

is rejected by gc with a "stupid shift" error, while gotype
compiles it successfully.

As suggested by gri on the issue tracker, allow an rsh right
operand to be any valid uint value.

Fixes #11328

Change-Id: I6ccb3b7f842338d91fd26ae37dd4fa279d7fc440
Reviewed-on: https://go-review.googlesource.com/13777
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/mparith2.go
test/const.go