changed cpu_compue_eflags to use the updated eflags variable. Otherwise, cli/sti and popfl may break, as we get the non-updated eflags (#1057)

Backports commit 360e9c60e1feb4a93e7e43f30858e38eac2d35f2 from unicorn
This commit is contained in:
dmarxn 2019-02-28 17:04:41 -05:00 committed by Lioncash
parent 245d2070fe
commit 7164ab5ff4
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -1724,8 +1724,8 @@ uint32_t cpu_cc_compute_all(CPUX86State *env1, int op);
static inline uint32_t cpu_compute_eflags(CPUX86State *env)
{
// Unicorn: Modified to use eflags0 instead of eflags
uint32_t eflags = env->eflags0;
// Unicorn: Modified to use eflags instead of eflags0
uint32_t eflags = env->eflags;
if (tcg_enabled(env->uc)) {
eflags = (eflags & ~(CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C | DF_MASK)) | cpu_cc_compute_all(env, CC_OP) | (env->df & DF_MASK);
}