aboutsummaryrefslogtreecommitdiffstats
path: root/src/3rdparty/masm
diff options
context:
space:
mode:
authorLiu Zheng <[email protected]>2024-08-08 10:15:07 +0800
committerUlf Hermann <[email protected]>2024-08-13 11:03:15 +0000
commitf83669821b960e95f76807d1d64db07926fe3f5b (patch)
tree5013df0c92eba9a43125a59562f13a2526744faf /src/3rdparty/masm
parent204649742485ae40e2741653ebc3ce279f731a1b (diff)
fix: mips array out of bounds
When the incoming data is 4, the index defined by this macro has a crash Log: mips array out of bounds Pick-to: 6.8 6.7 6.5 Change-Id: I5acff5479f17e55d5731443d08b0915c701968f6 Reviewed-by: Ulf Hermann <[email protected]>
Diffstat (limited to 'src/3rdparty/masm')
-rw-r--r--src/3rdparty/masm/disassembler/mips32/Mips32Opcode.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/3rdparty/masm/disassembler/mips32/Mips32Opcode.cpp b/src/3rdparty/masm/disassembler/mips32/Mips32Opcode.cpp
index 164217eb55..afe3661f48 100644
--- a/src/3rdparty/masm/disassembler/mips32/Mips32Opcode.cpp
+++ b/src/3rdparty/masm/disassembler/mips32/Mips32Opcode.cpp
@@ -228,7 +228,7 @@ void Mips32Opcode::formatJumpEncodingOpcode(uint32_t iOp, uint32_t index, uint32
void Mips32Opcode::formatREGIMMEncodingOpcode(uint8_t rs, uint8_t rt, int16_t imm, uint32_t* opcodePtr)
{
const char *opcodes[] = { "bltz", "bgez", "bltzl", "bgezl" };
- if (rt < sizeof(opcodes))
+ if (rt < 4)
FORMAT_INSTR(OPCODE_FMT "%s, 0x%x", opcodes[rt], registerName(rs), reinterpret_cast<unsigned>(opcodePtr+1) + (imm << 2));
else
FORMAT_INSTR("unknown REGIMM encoding opcode 0x%x", rt);