x86: fix the issue with prefix instruction declared in 2.0's RELEASE_NOTES
diff --git a/cs.c b/cs.c
index 12af4ae..484f4e5 100644
--- a/cs.c
+++ b/cs.c
@@ -360,7 +360,7 @@
c++;
} else {
- // combine this instruction with previous prefix instruction
+ // combine this instruction with previous prefix "instruction"
cs_insn *prev = get_prev_insn(insn_cache, f, total, total_size);
handle->combine(handle, &insn_cache[f], prev);
}
@@ -369,8 +369,17 @@
size -= insn_size;
offset += insn_size;
- if (count > 0 && c == count)
- break;
+ if (count > 0) {
+ // x86 hacky
+ if (!handle->prev_prefix) {
+ if (c == count)
+ break;
+ } else {
+ // only combine 1 prefix with regular instruction
+ if (c == count + 1)
+ break;
+ }
+ }
} else {
// encounter a broken instruction
// XXX: TODO: JOXEAN continue here