Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/21059 )

Change subject: python: Don't try to bind a stat group to the NULL simobject.
......................................................................

python: Don't try to bind a stat group to the NULL simobject.

That is a SimObject like object which is used when a SimObject
parameter is purposefully left empty, vs. being accidentally left
empty through a typo or accidental ommission.

It doesn't have a getCCObject method, and attempting to use it anyway
causes gem5 to crash.

Change-Id: Ie86321fbdbcc41cf88b7009184423acd7b64484b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21059
Reviewed-by: Andreas Sandberg <andreas.sandb...@arm.com>
Reviewed-by: Anthony Gutierrez <anthony.gutier...@amd.com>
Maintainer: Andreas Sandberg <andreas.sandb...@arm.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/python/m5/stats/__init__.py
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved; Looks good to me, approved
  Anthony Gutierrez: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/python/m5/stats/__init__.py b/src/python/m5/stats/__init__.py
index 4b118ea..ab11a9d 100644
--- a/src/python/m5/stats/__init__.py
+++ b/src/python/m5/stats/__init__.py
@@ -47,6 +47,7 @@

 import _m5.stats
 from m5.objects import Root
+from m5.params import isNullPointer
 from m5.util import attrdict, fatal

 # Stat exports
@@ -253,6 +254,8 @@

 def _bindStatHierarchy(root):
     def _bind_obj(name, obj):
+        if isNullPointer(obj):
+            return
         if m5.SimObject.isSimObjectVector(obj):
             for idx, obj in enumerate(obj):
                 _bind_obj("{}{}".format(name, idx), obj)

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

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ie86321fbdbcc41cf88b7009184423acd7b64484b
Gerrit-Change-Number: 21059
Gerrit-PatchSet: 2
Gerrit-Owner: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Anthony Gutierrez <anthony.gutier...@amd.com>
Gerrit-Reviewer: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to