Fix a range check on the ipr_index.

--HG--
extra : convert_revision : 84e25abd4bb2de0c877c883804d39feb019c7030
This commit is contained in:
Gabe Black 2006-11-01 18:46:18 -05:00
parent 2b11b47357
commit 6f78d49410

View file

@ -745,7 +745,7 @@ decode OPCODE default Unknown::unknown() {
0: OpcdecFault::hw_mfpr();
format HwMoveIPR {
1: hw_mfpr({{
int miscRegIndex = (ipr_index < NumInternalProcRegs) ?
int miscRegIndex = (ipr_index < MaxInternalProcRegs) ?
IprToMiscRegIndex[ipr_index] : -1;
if(miscRegIndex < 0 || !IprIsReadable(miscRegIndex) ||
miscRegIndex >= NumInternalProcRegs)
@ -760,7 +760,7 @@ decode OPCODE default Unknown::unknown() {
0: OpcdecFault::hw_mtpr();
format HwMoveIPR {
1: hw_mtpr({{
int miscRegIndex = (ipr_index < NumInternalProcRegs) ?
int miscRegIndex = (ipr_index < MaxInternalProcRegs) ?
IprToMiscRegIndex[ipr_index] : -1;
if(miscRegIndex < 0 || !IprIsWritable(miscRegIndex) ||
miscRegIndex >= NumInternalProcRegs)