From: Andreas Hansson Date: Fri, 19 Sep 2014 14:35:06 +0000 (-0400) Subject: mem: Check return value of checkFunctional in SimpleMemory X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=377f081251540e33743a8d8bc59d05e68d4e2782;p=gem5.git mem: Check return value of checkFunctional in SimpleMemory Simple fix to ensure we only iterate until we are done. --- 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(); }