diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2006-10-31 18:19:45 -0500 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2006-10-31 18:19:45 -0500 |
commit | 39de635fbfa281c2fa70b65833825e2559d029b9 (patch) | |
tree | 8afc389cacb001b72a1d67090bbd4119b37253ab /src/arch/alpha/isa/decoder.isa | |
parent | 45368c03001690aa7ea697afdbfaca01477fbdb2 (diff) | |
download | gem5-39de635fbfa281c2fa70b65833825e2559d029b9.tar.xz |
Check for out of range IPR values as well.
--HG--
extra : convert_revision : 9ca241bb71d8a1d022e54485383a88d2abece663
Diffstat (limited to 'src/arch/alpha/isa/decoder.isa')
-rw-r--r-- | src/arch/alpha/isa/decoder.isa | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/arch/alpha/isa/decoder.isa b/src/arch/alpha/isa/decoder.isa index 550aa62a3..e4cf96767 100644 --- a/src/arch/alpha/isa/decoder.isa +++ b/src/arch/alpha/isa/decoder.isa @@ -745,8 +745,10 @@ decode OPCODE default Unknown::unknown() { 0: OpcdecFault::hw_mfpr(); format HwMoveIPR { 1: hw_mfpr({{ - int miscRegIndex = IprToMiscRegIndex[ipr_index]; - if(miscRegIndex < 0 || !IprIsReadable(miscRegIndex)) + miscRegIndex >= NumInternalProcRegs) + int miscRegIndex = (ipr_index < NumInternalProcRegs) ? + IprToMiscRegIndex[ipr_index] : -1; + if(miscRegIndex < 0 || !IprIsReadable(miscRegIndex) || fault = new UnimplementedOpcodeFault; else Ra = xc->readMiscRegWithEffect(miscRegIndex, fault); @@ -758,7 +760,8 @@ decode OPCODE default Unknown::unknown() { 0: OpcdecFault::hw_mtpr(); format HwMoveIPR { 1: hw_mtpr({{ - int miscRegIndex = IprToMiscRegIndex[ipr_index]; + int miscRegIndex = (ipr_index < NumInternalProcRegs) ? + IprToMiscRegIndex[ipr_index] : -1; if(miscRegIndex < 0 || !IprIsWritable(miscRegIndex)) fault = new UnimplementedOpcodeFault; else |