VirtualBox

Changeset 39961 in vbox for trunk/src/recompiler/target-i386


Ignore:
Timestamp:
Feb 2, 2012 5:26:39 PM (13 years ago)
Author:
vboxsync
Message:

REM: Fixed incorrect CR2 value for word or dword instruction fields crossing page boundraries. (Our bug, really ancient.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/target-i386/translate.c

    r38364 r39961  
    111111    return b;
    112112}
    113 #define ldub_code(a) ldub_code_raw(a)
     113# define ldub_code(a) ldub_code_raw(a)
    114114
    115115uint16_t lduw_code_raw(target_ulong pc)
    116116{
    117     return (ldub_code(pc+1) << 8) | ldub_code(pc);
    118 }
    119 #define lduw_code(a) lduw_code_raw(a)
     117    uint16_t u16;
     118    u16  = (uint16_t)ldub_code_raw(pc);
     119    u16 |= (uint16_t)ldub_code_raw(pc + 1) << 8;
     120    return u16;
     121}
     122# define lduw_code(a) lduw_code_raw(a)
    120123
    121124
    122125uint32_t ldl_code_raw(target_ulong pc)
    123126{
    124     return (ldub_code(pc+3) << 24) | (ldub_code(pc+2) << 16) | (ldub_code(pc+1) << 8) | ldub_code(pc);
    125 }
    126 #define ldl_code(a) ldl_code_raw(a)
     127    uint32_t u32;
     128    u32  = (uint32_t)ldub_code_raw(pc);
     129    u32 |= (uint32_t)ldub_code_raw(pc + 1) << 8;
     130    u32 |= (uint32_t)ldub_code_raw(pc + 2) << 16;
     131    u32 |= (uint32_t)ldub_code_raw(pc + 3) << 24;
     132    return u32;
     133}
     134# define ldl_code(a) ldl_code_raw(a)
    127135
    128136#endif /* VBOX */
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