1
0
mirror of https://github.com/golang/go synced 2024-11-25 19:57:56 -07:00
This commit is contained in:
Jes Cok 2024-02-27 23:22:08 +08:00
parent 0225178195
commit eae2f49850

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
}