changeset 0a810481d511 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=0a810481d511
description:
        mem: Check return value of checkFunctional in SimpleMemory

        Simple fix to ensure we only iterate until we are done.

diffstat:

 src/mem/simple_mem.cc |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r a16e73f1297f -r 0a810481d511 src/mem/simple_mem.cc
--- a/src/mem/simple_mem.cc     Fri Sep 19 10:35:04 2014 -0400
+++ b/src/mem/simple_mem.cc     Fri Sep 19 10:35:06 2014 -0400
@@ -80,9 +80,13 @@
 
     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();
 }
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to