VirtualBox

Changeset 92806 in vbox for trunk/src/VBox


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

Disasm: Fixed wrong type for enum OPCODES in disInstrWorker, uint8_t is too small.

File:
1 edited

Legend:

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

    r91673 r92806  
    27332733    for (;;)
    27342734    {
    2735         uint8_t codebyte = disReadByte(pDis, offInstr++);
    2736         uint8_t opcode   = paOneByteMap[codebyte].uOpcode;
     2735        uint8_t  const bCode = disReadByte(pDis, offInstr++);
     2736        uint16_t const opcode = paOneByteMap[bCode].uOpcode;
    27372737
    27382738        /* Hardcoded assumption about OP_* values!! */
     
    27562756            // segment override prefix byte
    27572757            case OP_SEG:
    2758                 pDis->idxSegPrefix = (DISSELREG)(paOneByteMap[codebyte].fParam1 - OP_PARM_REG_SEG_START);
     2758                pDis->idxSegPrefix = (DISSELREG)(paOneByteMap[bCode].fParam1 - OP_PARM_REG_SEG_START);
    27592759#if 0  /* Try be accurate in our reporting, shouldn't break anything... :-) */
    27602760                /* Segment prefixes for CS, DS, ES and SS are ignored in long mode. */
     
    28062806                /* REX prefix byte */
    28072807                pDis->fPrefix   |= DISPREFIX_REX;
    2808                 pDis->fRexPrefix = DISPREFIX_REX_OP_2_FLAGS(paOneByteMap[codebyte].fParam1);
     2808                pDis->fRexPrefix = DISPREFIX_REX_OP_2_FLAGS(paOneByteMap[bCode].fParam1);
    28092809                if (pDis->fRexPrefix & DISPREFIX_REX_FLAGS_W)
    28102810                    pDis->uOpMode = DISCPUMODE_64BIT;  /* overrides size prefix byte */
     
    28242824
    28252825        /* first opcode byte. */
    2826         pDis->bOpCode  = codebyte;
     2826        pDis->bOpCode  = bCode;
    28272827        pDis->cbPrefix = (uint8_t)offInstr - 1;
    28282828
    2829         offInstr = disParseInstruction(offInstr, &paOneByteMap[pDis->bOpCode], pDis);
     2829        offInstr = disParseInstruction(offInstr, &paOneByteMap[bCode], pDis);
    28302830        break;
    28312831    }
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