changeset 762d3c8e55f4 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=762d3c8e55f4
description:
        sim: fix out-of-bounds error in syscall_desc

diffstat:

 src/sim/syscall_desc.cc |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (17 lines):

diff -r f438fcbab00e -r 762d3c8e55f4 src/sim/syscall_desc.cc
--- a/src/sim/syscall_desc.cc   Wed Feb 15 14:59:06 2017 -0600
+++ b/src/sim/syscall_desc.cc   Fri Feb 17 12:01:50 2017 -0500
@@ -49,10 +49,11 @@
     /**
      * 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
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to