thumb: Fix overflowing multiplication

Former-commit-id: 5dbd45f9fd3811726aad9c32444f0dcf42d0b8be
This commit is contained in:
Michel Heily 2019-07-13 23:33:37 +03:00
parent ab8c067616
commit f08da850c7

View file

@ -82,7 +82,7 @@ impl Core {
for _ in 0..m { for _ in 0..m {
self.add_cycle(); self.add_cycle();
} }
self.gpr[insn.rd()] = (op1 * op2) as u32; self.gpr[insn.rd()] = op1.wrapping_mul(op2) as u32;
Ok(CpuPipelineAction::IncPC) Ok(CpuPipelineAction::IncPC)
} }