Fix UBSAN complaint

This commit is contained in:
Anton Kochkov 2017-08-18 18:59:34 +08:00
parent e83be2ef26
commit e8b34389fc

View File

@ -6,8 +6,8 @@
ut32 get_msb(ut32 v) {
int i;
for (i = 31; i > (-1); i--) {
if (v & (0x1 << i)) {
return (v & (0x1 << i));
if (v & (0x1U << i)) {
return (v & (0x1U << i));
}
}
return 0;