Fix IsUnsigned

This commit is contained in:
Sasha Koshka 2023-12-07 17:05:26 -05:00
parent b2f8b85969
commit d16079cbe8

View File

@ -440,8 +440,8 @@ func isFloat (ty entity.Type) bool {
// IsUnsigned returns whether or not the specified type is an unsigned integer. // IsUnsigned returns whether or not the specified type is an unsigned integer.
func IsUnsigned (ty entity.Type) bool { func IsUnsigned (ty entity.Type) bool {
switch ty := ReduceToBase(ty).(type) { switch ty := ReduceToBase(ty).(type) {
case *entity.TypeInt: return ty.Signed case *entity.TypeInt: return !ty.Signed
case *entity.TypeWord: return ty.Signed case *entity.TypeWord: return !ty.Signed
default: return false default: return false
} }
} }