From 95863671a332886c01e60a148821c7b9bf94dea7 Mon Sep 17 00:00:00 2001 From: Logan McNaughton <848146+loganmc10@users.noreply.github.com> Date: Sun, 24 Jul 2022 09:00:25 -0600 Subject: [PATCH] Fix undefined behavior in LUI --- rsp_jit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rsp_jit.cpp b/rsp_jit.cpp index 372319c..a0e1c36 100644 --- a/rsp_jit.cpp +++ b/rsp_jit.cpp @@ -1422,7 +1422,7 @@ void CPU::jit_instruction(jit_state_t *_jit, uint32_t pc, uint32_t instr, unsigned rt = (instr >> 16) & 31; NOP_IF_RT_ZERO(); int16_t imm = int16_t(instr); - regs.immediate_mips_register(_jit, rt, imm << 16); + regs.immediate_mips_register(_jit, rt, uint16_t(imm) << 16); regs.unlock_mips_register(rt); break; }