Fix potential overflow in cycle calculation.

This commit is contained in:
Stephen Anthony 2024-07-31 13:41:42 -02:30
parent 9679d63bfc
commit 2fd4756f2d
1 changed files with 2 additions and 2 deletions

View File

@ -542,8 +542,8 @@ void CartridgeELF::runArm()
)
return;
const uInt32 cyclesGoal =
(mySystem->cycles() + ARM_RUNAHED_MAX) * myArmCyclesPer6502Cycle - getArmCycles();
const uInt32 cyclesGoal = static_cast<uInt32>(
(mySystem->cycles() + ARM_RUNAHED_MAX) * myArmCyclesPer6502Cycle - getArmCycles());
uInt32 cycles = 0;
const CortexM0::err_t err = myCortexEmu.run(cyclesGoal, cycles);