In the compiler frontend, walkinrange indiscriminately calls Int64()
on const CTINT nodes, even though Int64's return value is undefined
for anything over 2⁶³ (in practise, it'll return a negative number).
This causes the introduction of bad constants during rewrites of
unsigned expressions, which make the compiler reject valid Go
This change introduces a preliminary check that Int64() is safe to
call on the consts on hand. If it isn't, walkinrange exits without
doing any rewrite.
Run-TryBot: Josh Bleecher Snyder <email@example.com>
TryBot-Result: Gobot Gobot <firstname.lastname@example.org>
Reviewed-by: Josh Bleecher Snyder <email@example.com>
(cherry picked from commit 42cc4ca)
Reviewed-by: Robert Griesemer <firstname.lastname@example.org>
Run-TryBot: Andrew Bonventre <email@example.com>