In the parser, the shift value is always a uint64.
Change-Id: I9b50295a9f7d174ed1f6f9baf78ec0ed43db417f
Reviewed-on: https://go-review.googlesource.com/11322
Reviewed-by: Andrew Gerrand <adg@golang.org>
case lex.RSH:
p.next()
shift := p.term()
- if shift < 0 {
- p.errorf("negative right shift %d", shift)
- }
- if shift > 0 && value&(1<<63) != 0 {
+ // shift is a uint, so can never be negative.
+ if value&(1<<63) != 0 {
p.errorf("right shift with high bit set")
}
value >>= uint(shift)