Commit 71859efc authored by Rob Pike's avatar Rob Pike

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/11322Reviewed-by: 's avatarAndrew Gerrand <adg@golang.org>
parent 626188dd
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment