Skip to content

Commit f17bfd9

Browse files
authored
Fix #12242 - Crash in x86.nz assembler (#12266)
1 parent 2aaeb80 commit f17bfd9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: libr/asm/p/asm_x86_nz.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2023,9 +2023,9 @@ static int opmov(RAsm *a, ut8 *data, const Opcode *op) {
20232023
if (op->operands[1].scale[0] == 0) {
20242024
return -1;
20252025
}
2026-
data[l++] = SEG_REG_PREFIXES[op->operands[1].regs[0]];
2026+
data[l++] = SEG_REG_PREFIXES[op->operands[1].regs[0] % 6];
20272027
data[l++] = 0x8b;
2028-
data[l++] = op->operands[0].reg << 3 | 0x5;
2028+
data[l++] = (((ut32)op->operands[0].reg) << 3) | 0x5;
20292029
data[l++] = offset;
20302030
data[l++] = offset >> 8;
20312031
data[l++] = offset >> 16;

0 commit comments

Comments
 (0)