changeset 611fe187288e in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=611fe187288e
description:
        SimObject: Add a comment near clear_child that it's unlikely to be 
called.

diffstat:

 src/python/m5/SimObject.py |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (24 lines):

diff -r 340b6f01d69b -r 611fe187288e src/python/m5/SimObject.py
--- a/src/python/m5/SimObject.py        Thu Nov 11 02:03:58 2010 -0800
+++ b/src/python/m5/SimObject.py        Thu Nov 11 11:41:13 2010 -0800
@@ -652,7 +652,8 @@
     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 @@
                   "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
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to