summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2014-09-19 10:35:06 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2014-09-19 10:35:06 -0400
commit377f081251540e33743a8d8bc59d05e68d4e2782 (patch)
tree990ff36b93e34f4be6c6f84282e16d21127292ef /src
parent38646d48ebd32c551ce3c478e9dee47f83acdf1e (diff)
downloadgem5-377f081251540e33743a8d8bc59d05e68d4e2782.tar.xz
mem: Check return value of checkFunctional in SimpleMemory
Simple fix to ensure we only iterate until we are done.
Diffstat (limited to 'src')
-rw-r--r--src/mem/simple_mem.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mem/simple_mem.cc b/src/mem/simple_mem.cc
index 2549cbe39..b2d518dc7 100644
--- a/src/mem/simple_mem.cc
+++ b/src/mem/simple_mem.cc
@@ -80,9 +80,13 @@ SimpleMemory::recvFunctional(PacketPtr pkt)
functionalAccess(pkt);
+ bool done = false;
+ auto p = packetQueue.begin();
// potentially update the packets in our packet queue as well
- for (auto i = packetQueue.begin(); i != packetQueue.end(); ++i)
- pkt->checkFunctional(i->pkt);
+ while (!done && p != packetQueue.end()) {
+ done = pkt->checkFunctional(p->pkt);
+ ++p;
+ }
pkt->popLabel();
}