summaryrefslogtreecommitdiff
path: root/src/dev
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2012-05-10 18:04:27 -0500
committerAli Saidi <Ali.Saidi@ARM.com>2012-05-10 18:04:27 -0500
commit574566550941aec56611f79d589bb4200b4b5b48 (patch)
treef5af4f86f65cd107fde5bb808b0f1d3b0f17c50b /src/dev
parent4f66bcdd2e2cf983f66fe745eaa27698e90d0d60 (diff)
downloadgem5-574566550941aec56611f79d589bb4200b4b5b48.tar.xz
gem5: assert before indexing intro arrays to verify bounds
Diffstat (limited to 'src/dev')
-rw-r--r--src/dev/arm/gic.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/dev/arm/gic.cc b/src/dev/arm/gic.cc
index f686c2a13..94719f86f 100644
--- a/src/dev/arm/gic.cc
+++ b/src/dev/arm/gic.cc
@@ -193,10 +193,12 @@ Gic::readDistributor(PacketPtr pkt)
pkt->set<uint8_t>(int_p[int_num]);
break;
case 2:
+ assert((int_num + 1) < (SGI_MAX + PPI_MAX));
pkt->set<uint16_t>(int_p[int_num] |
int_p[int_num+1] << 8);
break;
case 4:
+ assert((int_num + 3) < (SGI_MAX + PPI_MAX));
pkt->set<uint32_t>(int_p[int_num] |
int_p[int_num+1] << 8 |
int_p[int_num+2] << 16 |