Gabe Black has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/44387 )
Change subject: python: Don't try setting the parent of null SimObject
pointers.
......................................................................
python: Don't try setting the parent of null SimObject pointers.
The line of code which would have added the null SimObject as a child
was already guarded by an if, but the line before it which would set the
parent of the null SimObject itself was not. This change moves it into
the if as well.
Change-Id: Icfbc0e87e0ab55917735f720de4e94c19185df46
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44387
Reviewed-by: Daniel Carvalho <[email protected]>
Maintainer: Gabe Black <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/python/m5/SimObject.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Daniel Carvalho: Looks good to me, approved
Gabe Black: Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py
index 8552939..766b722 100644
--- a/src/python/m5/SimObject.py
+++ b/src/python/m5/SimObject.py
@@ -1487,8 +1487,8 @@
# 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
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44387
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Icfbc0e87e0ab55917735f720de4e94c19185df46
Gerrit-Change-Number: 44387
Gerrit-PatchSet: 2
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s