diff --git a/target-mips/op.c b/target-mips/op.c index 6d94be631181811b093775e0d9f32db73ff0d276..df76e8e71e309fc9091c7199f71c0d1b39aa774e 100644 --- a/target-mips/op.c +++ b/target-mips/op.c @@ -597,10 +597,13 @@ void debug_eret (void); void op_eret (void) { CALL_FROM_TB0(debug_eret); - if (env->hflags & MIPS_HFLAG_ERL) + if (env->hflags & MIPS_HFLAG_ERL) { env->PC = env->CP0_ErrorEPC; - else + env->hflags &= ~MIPS_HFLAG_ERL; + } else { env->PC = env->CP0_EPC; + env->hflags &= ~MIPS_HFLAG_EXL; + } env->CP0_LLAddr = 1; }