asm/asm_x86_nz: fix "rep" instructions (#11373)

This commit is contained in:
Riccardo Schirone 2018-09-03 18:03:27 +02:00 committed by GitHub
parent 217edd4be5
commit c610b85209
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -4400,6 +4400,14 @@ static int parseOperand(RAsm *a, const char *str, Operand *op, bool isrepop) {
} else if (last_type == TT_WORD) { // register
nextpos = pos;
RFlagItem *flag;
if (isrepop) {
op->is_good_flag = false;
strncpy (op->rep_op, str, MAX_REPOP_LENGTH - 1);
op->rep_op[MAX_REPOP_LENGTH - 1] = '\0';
return nextpos;
}
op->reg = parseReg (a, str, &nextpos, &op->type);
op->extended = false;
@ -4414,10 +4422,6 @@ static int parseOperand(RAsm *a, const char *str, Operand *op, bool isrepop) {
if (op->reg == X86R_UNDEFINED) {
op->is_good_flag = false;
if (a->num && a->num->value == 0) {
if (isrepop) {
strncpy (op->rep_op, str, MAX_REPOP_LENGTH - 1);
op->rep_op[MAX_REPOP_LENGTH - 1] = '\0';
}
return nextpos;
}
op->type = OT_CONSTANT;