summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2010-11-11 11:41:13 -0800
committerGabe Black <gblack@eecs.umich.edu>2010-11-11 11:41:13 -0800
commit3c237f44c9cff846216ee2947605af4ffb8ee601 (patch)
tree557c9300e137b4a0a5198243bfdc43f0c40fab37
parentcdc585e0e8ceb305de83053c488ba041367b7cd6 (diff)
downloadgem5-3c237f44c9cff846216ee2947605af4ffb8ee601.tar.xz
SimObject: Add a comment near clear_child that it's unlikely to be called.
-rw-r--r--src/python/m5/SimObject.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py
index 61af57fb8..710f85fde 100644
--- a/src/python/m5/SimObject.py
+++ b/src/python/m5/SimObject.py
@@ -652,7 +652,8 @@ class SimObject(object):
def get_parent(self):
return self._parent
- # clear out child with given name
+ # clear out child with given name. This code is not likely to be exercised.
+ # See comment in add_child.
def clear_child(self, name):
child = self._children[name]
child.clear_parent(self)
@@ -666,6 +667,10 @@ class SimObject(object):
"add_child('%s'): child '%s' already has parent '%s'" % \
(name, child._name, child._parent)
if self._children.has_key(name):
+ # This code path had an undiscovered bug that would make it fail
+ # at runtime. It had been here for a long time and was only
+ # exposed by a buggy script. Changes here will probably not be
+ # exercised without specialized testing.
self.clear_child(name)
child.set_parent(self, name)
self._children[name] = child