Permalink
Browse files

Fix #12372 and #12373 - Crash in x86 assembler (#12380)

0 ,0,[bP-bL-bP-bL-bL-r-bL-bP-bL-bL-
mov ,0,[ax+Bx-ax+Bx-ax+ax+Bx-ax+Bx--
leA ,0,[bP-bL-bL-bP-bL-bP-bL-60@bL-
leA ,0,[bP-bL-r-bP-bL-bP-bL-60@bL-
mov ,0,[ax+Bx-ax+Bx-ax+ax+Bx-ax+Bx--
  • Loading branch information...
radare committed Dec 3, 2018
1 parent cd4d226 commit 9b46d38dd3c4de6048a488b655c7319f845af185
Showing with 7 additions and 4 deletions.
  1. +7 −4 libr/asm/p/asm_x86_nz.c
@@ -4575,14 +4575,17 @@ static int parseOperand(RAsm *a, const char *str, Operand *op, bool isrepop) {
if (last_type == TT_SPECIAL) {
if (str[pos] == '+' || str[pos] == '-' || str[pos] == ']') {
if (reg != X86R_UNDEFINED) {
op->regs[reg_index] = reg;
op->scale[reg_index] = temp;
if (reg_index < 2) {
op->regs[reg_index] = reg;
op->scale[reg_index] = temp;
}
++reg_index;
} else {
op->offset += temp;
op->regs[reg_index] = X86R_UNDEFINED;
if (reg_index < 2) {
op->regs[reg_index] = X86R_UNDEFINED;
}
}

temp = 1;
reg = X86R_UNDEFINED;
} else if (str[pos] == '*') {

0 comments on commit 9b46d38

Please sign in to comment.