This commit is contained in:
Jes Cok 2024-02-27 23:22:08 +08:00
parent 0225178195
commit eae2f49850
1 changed files with 1 additions and 1 deletions

View File

@ -358,7 +358,7 @@ func (t *rtype) OverflowUint(x uint64) bool {
k := t.Kind()
switch k {
case Uint, Uintptr, Uint8, Uint16, Uint32, Uint64:
bitSize := t.Size() * 8 // ok to use v.typ_ directly as Size doesn't escape
bitSize := t.Size() * 8
trunc := (x << (64 - bitSize)) >> (64 - bitSize)
return x != trunc
}