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}
This commit is contained in:
addaleax 2016-04-14 23:23:30 -07:00 committed by Commit bot
parent 88556b709b
commit 6336cc6b2b
3 changed files with 3 additions and 2 deletions

View File

@ -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>

View File

@ -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() {

View File

@ -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() {