Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/4846

Change subject: sim: Don't add the NULL SimObject as a child of other SimObjects.
......................................................................

sim: Don't add the NULL SimObject as a child of other SimObjects.

Change-Id: Ibdc48af8e5a461077f75d781cfd8191586c54115
---
M src/python/m5/SimObject.py
1 file changed, 4 insertions(+), 2 deletions(-)



diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py
index baeef73..cff818c 100644
--- a/src/python/m5/SimObject.py
+++ b/src/python/m5/SimObject.py
@@ -579,7 +579,8 @@
         # object is not an orphan and can provide better error
         # messages.
         child.set_parent(cls, name)
-        cls._children[name] = child
+        if not isNullPointer(child):
+            cls._children[name] = child

     def _new_port(cls, name, port):
         # each port should be uniquely assigned to one variable
@@ -1226,7 +1227,8 @@
             # exercised without specialized testing.
             self.clear_child(name)
         child.set_parent(self, name)
-        self._children[name] = child
+        if not isNullPointer(child):
+            self._children[name] = child

     # Take SimObject-valued parameters that haven't been explicitly
     # assigned as children and make them children of the object that

--
To view, visit https://gem5-review.googlesource.com/4846
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibdc48af8e5a461077f75d781cfd8191586c54115
Gerrit-Change-Number: 4846
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to