riscv: Fix crash when syscall argument reg index is too high
Review Request #3780 - Created Jan. 12, 2017 and submitted - Latest diff uploaded
| Information | |
|---|---|
| Alec Roelke | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 11795:3ac8305dbf60 --------------------------- riscv: Fix crash when syscall argument reg index is too high By default, doSyscall gets the values of six registers to be used for system call arguments. RISC-V, by convention, only has four. Because RISC-V's implementation of these indices is as arrays of integers rather than as base indices plus offsets, trying to get the fifth argument register's value will cause a crash. This patch fixes that by returning 0 for any index higher than 3.
