Bus: Only update port cache when there is an item to update it with.
authorNicolas Zea <nicolas.zea@gmail.com>
Mon, 11 Feb 2008 00:41:03 +0000 (19:41 -0500)
committerNicolas Zea <nicolas.zea@gmail.com>
Mon, 11 Feb 2008 00:41:03 +0000 (19:41 -0500)
--HG--
extra : convert_revision : 84848fd48bb9e6693a0518c862364142b1969aa8

src/mem/bus.cc

index 66b20703f406b4405b9f252c6924379b06f15a28..f47d48d0b6a55b2596f6c08dfaa500b084bab95b 100644 (file)
@@ -307,9 +307,10 @@ Bus::findPort(Addr addr)
     dest_id = checkPortCache(addr);
     if (dest_id == -1) {
         PortIter i = portMap.find(RangeSize(addr,1));
-        if (i != portMap.end())
-          dest_id = i->second;
-        updatePortCache(dest_id, i->first.start, i->first.end);
+        if (i != portMap.end()) {
+            dest_id = i->second;
+            updatePortCache(dest_id, i->first.start, i->first.end);
+        }
     }
 
     // Check if this matches the default range