mirror of
https://github.com/capstone-engine/capstone.git
synced 2025-02-12 18:08:42 +00:00
x86: fix the issue with prefix instruction declared in 2.0's RELEASE_NOTES
This commit is contained in:
parent
9389947d0d
commit
94020d8478
15
cs.c
15
cs.c
@ -360,7 +360,7 @@ size_t cs_disasm_ex(csh ud, const uint8_t *buffer, size_t size, uint64_t offset,
|
||||
|
||||
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_t cs_disasm_ex(csh ud, const uint8_t *buffer, size_t size, uint64_t offset,
|
||||
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
|
||||
|
@ -73,7 +73,7 @@ for (arch, mode, comment, syntax) in all_tests:
|
||||
|
||||
try:
|
||||
md = Cs(arch, mode)
|
||||
#md.detail = True
|
||||
md.detail = True
|
||||
|
||||
if syntax != 0:
|
||||
md.syntax = syntax
|
||||
|
Loading…
x
Reference in New Issue
Block a user