diff options
author | Brandon Potter <brandon.potter@amd.com> | 2017-02-17 12:01:50 -0500 |
---|---|---|
committer | Brandon Potter <brandon.potter@amd.com> | 2017-02-17 12:01:50 -0500 |
commit | 96f8ff57025947a6f2afd28ca4b8b6126a15b09d (patch) | |
tree | 999f649960f5212b06e3d41c951bf2ebcc0ff988 | |
parent | a854373d5901ae8c86c71dbbf7e369f6490daeac (diff) | |
download | gem5-96f8ff57025947a6f2afd28ca4b8b6126a15b09d.tar.xz |
sim: fix out-of-bounds error in syscall_desc
-rw-r--r-- | src/sim/syscall_desc.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sim/syscall_desc.cc b/src/sim/syscall_desc.cc index 34fb43dae..9251b1c14 100644 --- a/src/sim/syscall_desc.cc +++ b/src/sim/syscall_desc.cc @@ -49,10 +49,11 @@ SyscallDesc::doSyscall(int callnum, LiveProcess *process, ThreadContext *tc) /** * Step through the first six parameters for the system call and * 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; ) - arg[index] = process->getSyscallArg(tc, index); + arg[index - 1] = process->getSyscallArg(tc, index); /** * Linux supports up to six system call arguments through registers |