Fixed an intance of undefined behavior in sb_mpu401.c.

This commit is contained in:
OBattler
2020-01-08 19:01:24 +01:00
committed by GitHub
parent bb4e4e10c3
commit c524a62c40

View File

@@ -1216,7 +1216,8 @@ MPU401_Event(void *priv)
mpu->clock.cth_counter++;
if (mpu->clock.cth_counter >= mpu->clock.cth_rate[mpu->clock.cth_mode]) {
mpu->clock.cth_counter = 0;
mpu->clock.cth_mode= (++mpu->clock.cth_mode) % 4;
mpu->clock.cth_mode++;
mpu->clock.cth_mode %= 4;
mpu->state.req_mask |= (1 << 13);
}
}