changeset acc015106ac8 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=acc015106ac8
description:
config: Fix for port references generated multiple times
SimObjects are expected to only generate one port reference per
port belonging to them. There is a subtle bug with using "not"
here as a VectorPort is seen as not having a reference if it is
either None or empty as per Python docs sec 9.9 for Standard operators.
Intended behavior is to only check if we have not created the reference.
diffstat:
src/python/m5/SimObject.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (12 lines):
diff -r 735d73e394d3 -r acc015106ac8 src/python/m5/SimObject.py
--- a/src/python/m5/SimObject.py Thu Oct 17 10:20:45 2013 -0500
+++ b/src/python/m5/SimObject.py Thu Oct 17 10:20:45 2013 -0500
@@ -698,7 +698,7 @@
# via __setattr__. There is only ever one reference
# object per port, but we create them lazily here.
ref = self._port_refs.get(attr)
- if not ref:
+ if ref == None:
ref = self._ports[attr].makeRef(self)
self._port_refs[attr] = ref
return ref
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev