Fix an undefined bit shift.

Shouldn't have mattered anyway, but maybe this can crash some ARM chip or
something...
This commit is contained in:
Unknown W. Brackets 2015-01-19 08:38:55 -08:00
parent 85fa35f651
commit cdddd4b59c
2 changed files with 4 additions and 4 deletions

View File

@ -162,7 +162,7 @@ namespace MIPSComp
u32 value = gpr.GetImm(rs);
int x = 31;
int count = 0;
while (!(value & (1 << x)) && x >= 0) {
while (x >= 0 && !(value & (1 << x))) {
count++;
x--;
}
@ -177,7 +177,7 @@ namespace MIPSComp
u32 value = gpr.GetImm(rs);
int x = 31;
int count = 0;
while ((value & (1 << x)) && x >= 0) {
while (x >= 0 && (value & (1 << x)))
count++;
x--;
}

View File

@ -210,7 +210,7 @@ namespace MIPSComp
u32 value = gpr.GetImm(rs);
int x = 31;
int count = 0;
while (!(value & (1 << x)) && x >= 0)
while (x >= 0 && !(value & (1 << x)))
{
count++;
x--;
@ -241,7 +241,7 @@ namespace MIPSComp
u32 value = gpr.GetImm(rs);
int x = 31;
int count = 0;
while ((value & (1 << x)) && x >= 0)
while (x >= 0 && (value & (1 << x)))
{
count++;
x--;