cpu/drcbearm64.cpp, src/drcbec.cpp: Fixed off-by-one errors in map variable handling.

This commit is contained in:
Vas Crabb 2025-01-17 03:49:28 +11:00
parent 8954c5fd89
commit 4621f74889
2 changed files with 2 additions and 1 deletions

View File

@ -1625,6 +1625,7 @@ void drcbe_arm64::op_recover(a64::Assembler &a, const uml::instruction &inst)
get_imm_relative(a, REG_PARAM1, m_drcmap_get_value.obj);
a.ldr(REG_PARAM2, arm::Mem(a64::x29, -8)); // saved LR (x30) from first level CALLH/EXH or failed hash jump
a.sub(REG_PARAM2, REG_PARAM2, 4);
a.mov(REG_PARAM3, inst.param(1).mapvar());
call_arm_addr(a, m_drcmap_get_value.func);

View File

@ -676,7 +676,7 @@ int drcbe_c::execute(code_handle &entry)
case MAKE_OPCODE_SHORT(OP_RECOVER, 4, 0): // RECOVER dst,mapvar
assert(sp > 0);
PARAM0 = m_map.get_value((drccodeptr)callstack[0], MAPVAR_M0 + PARAM1);
PARAM0 = m_map.get_value(drccodeptr(callstack[0] - 1), PARAM1);
break;