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

Fixes lifting disassembler bug for Pcmp #1222

Merged
merged 1 commit into from
Sep 24, 2020
Merged
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
4 changes: 2 additions & 2 deletions plugins/x86/x86_disasm.ml
Original file line number Diff line number Diff line change
Expand Up @@ -999,9 +999,9 @@ let parse_instr mode mem addr =
(Punpck(prefix.mopsize, elemt, order, r, rm, rv), na)
| 0x64 | 0x65 | 0x66 | 0x74 | 0x75 | 0x76 as o ->
let r, rm, rv, na = parse_modrm_vec None na in
let elet = match o land 0x6 with | 0x4 -> reg8_t | 0x5 -> reg16_t | 0x6 -> reg32_t | _ ->
let elet = match o land 0x0F with | 0x4 -> reg8_t | 0x5 -> reg16_t | 0x6 -> reg32_t | _ ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any references or explanations?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was a typo, this is what the author meant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(you can check the behavior against http://ref.x86asm.net/coder64.html ; pretty clearly the case that leaves elet=reg16_t isn't supposed to be dead code :P )

disfailwith "impossible" in
let bop, bstr = match o land 0x70 with
let bop, bstr = match o land 0xF0 with
| 0x70 -> Bil.EQ, "pcmpeq"
| 0x60 -> Bil.SLT, "pcmpgt"
| _ -> disfailwith "impossible" in
Expand Down