From 8fbebead19543ced8d56cd10ddc48e5ee7755b19 Mon Sep 17 00:00:00 2001 From: SarahW Date: Tue, 20 Jun 2017 19:32:58 +0100 Subject: [PATCH] CHECK_READ()/CHECK_WRITE() now handle code segments. Patch from Greatpsycho. --- src/386_common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/386_common.h b/src/386_common.h index 88a92fc..36519fa 100644 --- a/src/386_common.h +++ b/src/386_common.h @@ -38,14 +38,14 @@ int checkio(int port); } #define CHECK_READ(seg, low, high) \ - if ((low < (seg)->limit_low) || (high > (seg)->limit_high)) \ + if ((low < (seg)->limit_low) || (high > (seg)->limit_high) || ((msw & 1) && !(eflags & VM_FLAG) && (((seg)->access & 10) == 8))) \ { \ x86gpf("Limit check", 0); \ return 1; \ } #define CHECK_WRITE(seg, low, high) \ - if ((low < (seg)->limit_low) || (high > (seg)->limit_high) || !((seg)->access & 2)) \ + if ((low < (seg)->limit_low) || (high > (seg)->limit_high) || !((seg)->access & 2) || ((msw & 1) && !(eflags & VM_FLAG) && ((seg)->access & 8))) \ { \ x86gpf("Limit check", 0); \ return 1; \