From d3049dfe830f7951be222483eec231ea1792c60c Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 10 Apr 2011 08:37:18 +0000 Subject: [PATCH] i286 - Fixed protected mode boundary check [Miodrag Milanovic] --- src/emu/cpu/i86/instr286.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emu/cpu/i86/instr286.c b/src/emu/cpu/i86/instr286.c index e78e80f86fd..6765995d15c 100644 --- a/src/emu/cpu/i86/instr286.c +++ b/src/emu/cpu/i86/instr286.c @@ -335,7 +335,7 @@ static void i80286_check_permission(i8086_state *cpustate, UINT8 check_seg, UINT throw GENERAL_PROTECTION_FAULT; /* Would we go past the segment boundary? */ - if ( offset + size > cpustate->limit[check_seg] ) + if ( (offset + (size-1)) > cpustate->limit[check_seg] ) { throw GENERAL_PROTECTION_FAULT; }