diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py index 8552939101..766b722278 100644 --- a/src/python/m5/SimObject.py +++ b/src/python/m5/SimObject.py @@ -1487,8 +1487,8 @@ class SimObject(object, metaclass=MetaSimObject): # exposed by a buggy script. Changes here will probably not be # exercised without specialized testing. self.clear_child(name) - child.set_parent(self, name) if not isNullPointer(child): + child.set_parent(self, name) self._children[name] = child # Take SimObject-valued parameters that haven't been explicitly