aboutsummaryrefslogtreecommitdiffstats
path: root/src/3rdparty/masm
diff options
context:
space:
mode:
authorLiu Zheng <[email protected]>2024-08-15 10:34:56 +0800
committerLiu Zheng <[email protected]>2024-08-19 08:56:29 +0800
commit8541bab2f040ddc2c5d096791f37715df83bc2df (patch)
tree46f367872b20846ddcee0e38c367761f62778bb7 /src/3rdparty/masm
parentb1ae89155b225c7f0df080a0026a46127eda57bc (diff)
Optimize fixed numbers
Optimize fixed numbers to facilitate subsequent character array expansion Pick-to: 6.8 6.7 6.5 Change-Id: Ieb3b2ba527a88054594e00ddbf1072cccefb6965 Reviewed-by: Fabian Kosmale <[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 afe3661f48..bf6a448863 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 < 4)
+ if (rt < sizeof(opcodes) /sizeof(decltype(opcodes[0])))
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);