summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNicolas Zea <nicolas.zea@gmail.com>2008-02-10 19:41:03 -0500
committerNicolas Zea <nicolas.zea@gmail.com>2008-02-10 19:41:03 -0500
commit4c7eb211191055f72c6f157913cb384f47cf4334 (patch)
treea090b9523cd0198b643091c7fbd9145ae7c300ef /src
parentd167e2bb971327f030f1a7a71a45b7588a1dd3dc (diff)
downloadgem5-4c7eb211191055f72c6f157913cb384f47cf4334.tar.xz
Bus: Only update port cache when there is an item to update it with.
--HG-- extra : convert_revision : 84848fd48bb9e6693a0518c862364142b1969aa8
Diffstat (limited to 'src')
-rw-r--r--src/mem/bus.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mem/bus.cc b/src/mem/bus.cc
index 66b20703f..f47d48d0b 100644
--- a/src/mem/bus.cc
+++ b/src/mem/bus.cc
@@ -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