From: Rob Pike Date: Mon, 22 Jun 2015 01:02:44 +0000 (-0700) Subject: cmd/asm: remove needless check for negative right shift X-Git-Tag: go1.5beta1~159 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=71859efceb21a3f8098716ad8cf0964571be7bc5;p=gostls13.git cmd/asm: remove needless check for negative right shift 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 --- diff --git a/src/cmd/asm/internal/asm/parse.go b/src/cmd/asm/internal/asm/parse.go index 7f956cb2a8..d7b5250913 100644 --- a/src/cmd/asm/internal/asm/parse.go +++ b/src/cmd/asm/internal/asm/parse.go @@ -812,10 +812,8 @@ func (p *Parser) term() uint64 { 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)