Fix Num_Syscall_Descs check bug in non-x86 ISAs.
authorSteve Reinhardt <stever@gmail.com>
Sun, 1 Mar 2009 01:14:22 +0000 (20:14 -0500)
committerSteve Reinhardt <stever@gmail.com>
Sun, 1 Mar 2009 01:14:22 +0000 (20:14 -0500)
(See cset d35d2b28df38 for x86 fix.)

src/arch/alpha/linux/process.cc
src/arch/mips/linux/process.cc
src/arch/sparc/linux/process.cc
src/arch/sparc/solaris/process.cc

index 1e4f7579098d9d51c45eab13434367499191f35f..aeff9fbed58ef4d0138befe7fe0526471c833202 100644 (file)
@@ -579,7 +579,7 @@ AlphaLinuxProcess::AlphaLinuxProcess(LiveProcessParams * params,
 SyscallDesc*
 AlphaLinuxProcess::getDesc(int callnum)
 {
-    if (callnum < 0 || callnum > Num_Syscall_Descs)
+    if (callnum < 0 || callnum >= Num_Syscall_Descs)
         return NULL;
     return &syscallDescs[callnum];
 }
index dc3b84ced3dbf61e49c69e1f0946d469bad7dd38..24e71305a244f5acce1b9ae18f5254adf1c6c2da 100644 (file)
@@ -425,7 +425,7 @@ MipsLinuxProcess::getDesc(int callnum)
     //MIPS32 syscalls are in the range of 4000 - 4999
     int m5_sys_idx = callnum - 4000;
 
-    if (m5_sys_idx < 0 || m5_sys_idx > Num_Syscall_Descs)
+    if (m5_sys_idx < 0 || m5_sys_idx >= Num_Syscall_Descs)
         return NULL;
 
     return &syscallDescs[m5_sys_idx];
index f4ec28c0081ca8efeaa6eb5ba2723c409ed3b28f..2078c1dced3e4f28120ee937af519b6a2fc345a7 100644 (file)
@@ -47,7 +47,7 @@ using namespace SparcISA;
 SyscallDesc*
 SparcLinuxProcess::getDesc(int callnum)
 {
-    if (callnum < 0 || callnum > Num_Syscall_Descs)
+    if (callnum < 0 || callnum >= Num_Syscall_Descs)
         return NULL;
     return &syscallDescs[callnum];
 }
@@ -55,7 +55,7 @@ SparcLinuxProcess::getDesc(int callnum)
 SyscallDesc*
 SparcLinuxProcess::getDesc32(int callnum)
 {
-    if (callnum < 0 || callnum > Num_Syscall32_Descs)
+    if (callnum < 0 || callnum >= Num_Syscall32_Descs)
         return NULL;
     return &syscall32Descs[callnum];
 }
index 1a4940b59703c8d66cc3a2b1aad40d428af0785a..22924736ba966cdf808170f94cb518a92cac6827 100644 (file)
@@ -336,7 +336,7 @@ SparcSolarisProcess::SparcSolarisProcess(LiveProcessParams * params,
 SyscallDesc*
 SparcSolarisProcess::getDesc(int callnum)
 {
-    if (callnum < 0 || callnum > Num_Syscall_Descs)
+    if (callnum < 0 || callnum >= Num_Syscall_Descs)
         return NULL;
     return &syscallDescs[callnum];
 }