summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Scott Percival <code@moral.net.au>2017-03-22 22:10:00 +0800
committer Scott Percival <code@moral.net.au>2017-03-23 19:55:19 +0800
commitfe117988c2234dc85713793d1bffeaa92372a4dd (patch)
tree5fcd9d62fde7b22ce85f539844bab651b6eeaa98
parent873ef1ff7e791d44f2e2659de891da15c0813375 (diff)
i386: fix enum range check
-rw-r--r--src/devices/cpu/i386/i386ops.hxx2
-rw-r--r--src/devices/cpu/i386/pentops.hxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/devices/cpu/i386/i386ops.hxx b/src/devices/cpu/i386/i386ops.hxx
index 1d00ac21566..5940b2b401c 100644
--- a/src/devices/cpu/i386/i386ops.hxx
+++ b/src/devices/cpu/i386/i386ops.hxx
@@ -2559,7 +2559,7 @@ void i386_device::i386_loadall() // Opcode 0x0f 0x07 (0x0f 0x05 on 80286),
m_sreg[ES].limit = READ32(ea + 0xc8);
m_CPL = (m_sreg[SS].flags >> 5) & 3; // cpl == dpl of ss
- for(int i = 0; i < GS; i++)
+ for(int i = 0; i <= GS; i++)
{
m_sreg[i].valid = (m_sreg[i].flags & 0x80) ? true : false;
m_sreg[i].d = (m_sreg[i].flags & 0x4000) ? 1 : 0;
diff --git a/src/devices/cpu/i386/pentops.hxx b/src/devices/cpu/i386/pentops.hxx
index 42d3958cd0a..28b469b21c2 100644
--- a/src/devices/cpu/i386/pentops.hxx
+++ b/src/devices/cpu/i386/pentops.hxx
@@ -166,7 +166,7 @@ void i386_device::pentium_rsm()
m_CPL = (m_sreg[SS].flags >> 13) & 3; // cpl == dpl of ss
- for(int i = 0; i < GS; i++)
+ for(int i = 0; i <= GS; i++)
{
if(PROTECTED_MODE && !V8086_MODE)
{