summaryrefslogtreecommitdiff
path: root/target-i386
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-12-04 22:17:10 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-12-04 22:17:10 +0000
commit89984cd2e5e70e23b63109988c1156c76a31121d (patch)
treeb0001a0810cfd1344bf93bfc637dd72e2a1398b1 /target-i386
parentee0971849e6110e14e10eaabb12b7adec7169668 (diff)
downloadqemu-89984cd2e5e70e23b63109988c1156c76a31121d.tar.gz
segment validation fix in lret/iret
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1684 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/helper.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 5c1d6cd80d..0c5e362c73 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1584,7 +1584,7 @@ void load_seg(int seg_reg, int selector)
if (!(e2 & DESC_CS_MASK) || !(e2 & DESC_C_MASK)) {
/* if not conforming code, test rights */
- if (dpl < cpl || dpl < rpl)
+ if (dpl < cpl || dpl < rpl)
raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
}
}
@@ -2152,10 +2152,10 @@ static inline void helper_ret_protected(int shift, int is_iret, int addend)
sp_mask = get_sp_mask(ss_e2);
/* validate data segments */
- validate_seg(R_ES, cpl);
- validate_seg(R_DS, cpl);
- validate_seg(R_FS, cpl);
- validate_seg(R_GS, cpl);
+ validate_seg(R_ES, rpl);
+ validate_seg(R_DS, rpl);
+ validate_seg(R_FS, rpl);
+ validate_seg(R_GS, rpl);
sp += addend;
}