core/x86/instr.c
/* This routine does NOT decode the cti of instr if the raw bits are valid,
 * since all short ctis have single-byte opcodes and so just grabbing the first
 * byte can tell if instr is a cti short
 */
This routine does NOT decode the cti of instr if the raw bits are valid,
since all short ctis have single-byte opcodes and so just grabbing the first
byte can tell if instr is a cti short
This routine does NOT decode the cti of instr if the raw bits are valid since all short ctis have single - byte opcodes and so just grabbing the first byte can tell if instr is a cti short
bool 
instr_is_cti_short(instr_t *instr)
{
    int opc;
    if (instr_opcode_valid(instr)) 
        opc = instr_get_opcode(instr);
    else if (instr_raw_bits_valid(instr)) { 
        opc = (int) *(instr_get_raw_bits(instr));
        return (opc == RAW_OPCODE_jmp_short ||
                (opc >= RAW_OPCODE_jcc_short_start &&
                 opc <= RAW_OPCODE_jcc_short_end) ||
                (opc >= RAW_OPCODE_loop_start && opc <= RAW_OPCODE_loop_end));
    } else 
        opc = instr_get_opcode(instr);
    return (opc == OP_jmp_short ||
            (opc >= OP_jo_short && opc <= OP_jnle_short) ||
            (opc >= OP_loopne && opc <= OP_jecxz));
}
bool instr_is_cti_short ( instr_t * instr ) { int opc ; if ( instr_opcode_valid ( instr ) ) opc = instr_get_opcode ( instr ) ; else if ( instr_raw_bits_valid ( instr ) ) { opc = ( int ) * ( instr_get_raw_bits ( instr ) ) ; return ( opc == RAW_OPCODE_jmp_short || ( opc >= RAW_OPCODE_jcc_short_start && opc <= RAW_OPCODE_jcc_short_end ) || ( opc >= RAW_OPCODE_loop_start && opc <= RAW_OPCODE_loop_end ) ) ; } else opc = instr_get_opcode ( instr ) ; return ( opc == OP_jmp_short || ( opc >= OP_jo_short && opc <= OP_jnle_short ) || ( opc >= OP_loopne && opc <= OP_jecxz ) ) ; }
This routine does NOT decode the cti of instr if the raw bits are valid,
 since all short ctis have single-byte opcodes and so just grabbing the first
 byte can tell if instr is a cti short
This routine does NOT decode the cti of instr if the raw bits are valid since all short ctis have single - byte opcodes and so just grabbing the first byte can tell if instr is a cti short
/* 1st choice: set opcode */ /* 2nd choice: 1st byte */ /* get raw opcode
         * FIXME: figure out which callers really rely on us not
         * up-decoding here -- if nobody then just do the
         * instr_get_opcode() and get rid of all this
         */ /* ok, fine, decode opcode */