TimingEvent: Fix possible negative tick execution

This commit is contained in:
Connor McLaughlin 2021-07-03 14:29:39 +10:00
parent dbe5f3c30c
commit a6abf7a83d

View file

@ -455,7 +455,7 @@ void TimingEvent::InvokeEarly(bool force /* = false */)
const TickCount pending_ticks = CPU::GetPendingTicks(); const TickCount pending_ticks = CPU::GetPendingTicks();
const TickCount ticks_to_execute = m_time_since_last_run + pending_ticks; const TickCount ticks_to_execute = m_time_since_last_run + pending_ticks;
if (!force && ticks_to_execute < m_period) if ((!force && ticks_to_execute < m_period) || ticks_to_execute <= 0)
return; return;
m_downcount = pending_ticks + m_interval; m_downcount = pending_ticks + m_interval;