Commit 6336cc6b authored by addaleax's avatar addaleax Committed by Commit bot

Fix testing of the VEX.L (128/256-bit) flag in the x64 disassembler

The current code for testing the VEX.L flag, indicating whether
128-bit or 256-bit registers are being accessed, was erroneous
and always returned true (i.e. indicated 128-bit registers).

This patch fixes this behaviour and checks the flag correctly.

Ref: https://github.com/nodejs/node/issues/6151

BUG=

Review URL: https://codereview.chromium.org/1875323002

Cr-Commit-Position: refs/heads/master@{#35506}
parent 88556b70
......@@ -40,6 +40,7 @@ Alexis Campailla <alexis@janeasystems.com>
Andreas Anyuru <andreas.anyuru@gmail.com>
Andrew Paprocki <andrew@ishiboo.com>
Andrei Kashcha <anvaka@gmail.com>
Anna Henningsen <addaleax@gmail.com>
Bangfu Tao <bangfu.tao@samsung.com>
Ben Noordhuis <info@bnoordhuis.nl>
Benjamin Tan <demoneaux@gmail.com>
......
......@@ -282,7 +282,7 @@ class DisassemblerIA32 {
bool vex_128() {
DCHECK(vex_byte0_ == 0xc4 || vex_byte0_ == 0xc5);
byte checked = vex_byte0_ == 0xc4 ? vex_byte2_ : vex_byte1_;
return (checked & 4) != 1;
return (checked & 4) == 0;
}
bool vex_none() {
......
......@@ -360,7 +360,7 @@ class DisassemblerX64 {
bool vex_128() {
DCHECK(vex_byte0_ == VEX3_PREFIX || vex_byte0_ == VEX2_PREFIX);
byte checked = vex_byte0_ == VEX3_PREFIX ? vex_byte2_ : vex_byte1_;
return (checked & 4) != 1;
return (checked & 4) == 0;
}
bool vex_none() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment