From 0fca011bd46a319a887fc56b2c6cbe46280d7784 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 18 Oct 2020 23:05:58 +1000 Subject: [PATCH] CPU/Recompiler: Fix OOB in register pairing --- src/core/cpu_recompiler_register_cache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/cpu_recompiler_register_cache.cpp b/src/core/cpu_recompiler_register_cache.cpp index 00e0d3281..1a4a69d40 100644 --- a/src/core/cpu_recompiler_register_cache.cpp +++ b/src/core/cpu_recompiler_register_cache.cpp @@ -379,7 +379,7 @@ void RegisterCache::ReserveCalleeSavedRegisters() // can we find a paired register? (mainly for ARM) u32 reg_pair; - for (reg_pair = reg + 1; reg < HostReg_Count; reg_pair++) + for (reg_pair = reg + 1; reg_pair < HostReg_Count; reg_pair++) { if ((m_state.host_reg_state[reg_pair] & (HostRegState::CalleeSaved | HostRegState::CalleeSavedAllocated)) == HostRegState::CalleeSaved)