Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[next] Fix #2244: Don't apply pseudo-instr. offset to vcmp id #2331

Merged
merged 1 commit into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,7 @@ size_t CAPSTONE_API cs_disasm(csh ud, const uint8_t *buffer, size_t size, uint64
fill_insn(handle, insn_cache, ss.buffer, &mci, handle->post_printer, buffer);

// adjust for pseudo opcode (X86)
if (handle->arch == CS_ARCH_X86)
if (handle->arch == CS_ARCH_X86 && insn_cache->id != X86_INS_VCMP)
insn_cache->id += mci.popcode_adjust;

next_offset = insn_size;
Expand Down
4 changes: 4 additions & 0 deletions suite/cstest/issues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1074,3 +1074,7 @@
!# issue 2079
!# CS_ARCH_X86, CS_MODE_32, CS_OPT_DETAIL
0x0: 0xd1,0x10 == rcl dword ptr [eax] ; operands[1].type: IMM = 0x1

!# issue 2244
!# CS_ARCH_X86, CS_MODE_64, CS_OPT_DETAIL
0x0: 0xc5,0xfb,0xc2,0xda,0x06 == vcmpnlesd xmm3, xmm0, xmm2 ; ID: 797
1 change: 1 addition & 0 deletions suite/cstest/src/x86_detail.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ char *get_detail_x86(csh *ud, cs_mode mode, cs_insn *ins)

x86 = &(ins->detail->x86);

add_str(&result, " ; ID: %" PRIu32 , ins->id);
print_string_hex(&result, " ; Prefix:", x86->prefix, 4);
print_string_hex(&result, " ; Opcode:", x86->opcode, 4);
add_str(&result, " ; rex: 0x%x", x86->rex);
Expand Down
Loading