VirtualBox

Changeset 92807 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 8, 2021 10:31:13 AM (3 years ago)
Author:
vboxsync
Message:

Disasm: Better just use the OPCODES enum type.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Disassembler/DisasmCore.cpp

    r92806 r92807  
    27332733    for (;;)
    27342734    {
    2735         uint8_t  const bCode  = disReadByte(pDis, offInstr++);
    2736         uint16_t const opcode = paOneByteMap[bCode].uOpcode;
     2735        uint8_t  const     bCode     = disReadByte(pDis, offInstr++);
     2736        enum OPCODES const enmOpcode = (enum OPCODES)paOneByteMap[bCode].uOpcode;
    27372737
    27382738        /* Hardcoded assumption about OP_* values!! */
    2739         if (opcode <= OP_LAST_PREFIX)
     2739        if (enmOpcode <= OP_LAST_PREFIX)
    27402740        {
    27412741            /* The REX prefix must precede the opcode byte(s). Any other placement is ignored. */
    2742             if (opcode != OP_REX)
     2742            if (enmOpcode != OP_REX)
    27432743            {
    27442744                /* Last prefix byte (for SSE2 extension tables); don't include the REX prefix */
    2745                 pDis->bLastPrefix = opcode;
    2746                 pDis->fPrefix &= ~DISPREFIX_REX;
     2745                pDis->bLastPrefix = (uint8_t)enmOpcode;
     2746                pDis->fPrefix    &= ~DISPREFIX_REX;
    27472747            }
    27482748
    2749             switch (opcode)
     2749            switch (enmOpcode)
    27502750            {
    27512751            case OP_INVALID:
     
    28172817        /* Check if this is a VEX prefix. Not for 32-bit mode. */
    28182818        if (pDis->uCpuMode != DISCPUMODE_64BIT
    2819             && (opcode == OP_LES || opcode == OP_LDS)
     2819            && (enmOpcode == OP_LES || enmOpcode == OP_LDS)
    28202820            && (disReadByte(pDis, offInstr) & 0xc0) == 0xc0)
    28212821        {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette