Fixed the parsing of the operand sign (#10166)

This commit is contained in:
Paolo Monti 2018-05-23 11:14:30 +02:00 committed by radare
parent 2ca2a0ae15
commit 36a3fa526a

View File

@ -4309,6 +4309,13 @@ static int parseOperand(RAsm *a, const char *str, Operand *op, bool isrepop) {
op->offset_sign = -1;
}
}
//with SIB notation, we need to consider the right sign
char * plus = strchr (str, '+');
char * minus = strchr (str, '-');
char * closeB = strchr (str, ']');
if (plus && minus && plus < closeB && minus < closeB) {
op->offset_sign = -1;
}
// If there's a scale, we don't want to parse out the
// scale with the offset (scale + offset) otherwise the scale
// will be the sum of the two. This splits the numbers