Fixed signed long comparisons with smaller unsigned types.

This commit is contained in:
acqn
2022-03-03 20:24:14 +08:00
committed by mrdudz
parent 0dc82c0d11
commit 43abc5b01f
2 changed files with 45 additions and 4 deletions

View File

@@ -2587,12 +2587,9 @@ static void hie_compare (const GenDesc* Ops, /* List of generators */
CmpSigned = 0;
flags |= CF_UNSIGNED;
}
} else {
unsigned rtype = TypeOf (Expr2.Type) | (flags & CF_CONST);
if (CmpSigned) {
ltype &= ~CF_UNSIGNED;
rtype &= ~CF_UNSIGNED;
}
flags |= g_typeadjust (ltype, rtype);
}