sim: fix out-of-bounds error in syscall_desc

This commit is contained in:
Brandon Potter
2017-02-17 12:01:50 -05:00
parent a854373d59
commit 96f8ff5702

View File

@@ -49,10 +49,11 @@ SyscallDesc::doSyscall(int callnum, LiveProcess *process, ThreadContext *tc)
/** /**
* Step through the first six parameters for the system call and * Step through the first six parameters for the system call and
* retrieve their values. Note that index is incremented as a * retrieve their values. Note that index is incremented as a
* side-effect of the calling method. * side-effect of the getSyscallArg method which is why the LHS
* needs the "-1".
*/ */
for (int index = 0; index < 6; ) for (int index = 0; index < 6; )
arg[index] = process->getSyscallArg(tc, index); arg[index - 1] = process->getSyscallArg(tc, index);
/** /**
* Linux supports up to six system call arguments through registers * Linux supports up to six system call arguments through registers