diff options
author | Gabe Black <gabeblack@google.com> | 2019-09-18 20:27:13 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2019-09-19 18:31:43 +0000 |
commit | 2455f6c0dd61f37d95f786cae02bcfc9ac18f048 (patch) | |
tree | ae70e0393348cfbfd50be78f87130c0191d9cd94 /src/python | |
parent | 8716d3abceafe4e41a25a1df9c66e79b577710ae (diff) | |
download | gem5-2455f6c0dd61f37d95f786cae02bcfc9ac18f048.tar.xz |
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.sandberg@arm.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/python')
-rw-r--r-- | src/python/m5/stats/__init__.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/python/m5/stats/__init__.py b/src/python/m5/stats/__init__.py index 4b118ea13..ab11a9d61 100644 --- a/src/python/m5/stats/__init__.py +++ b/src/python/m5/stats/__init__.py @@ -47,6 +47,7 @@ import m5 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 _visit_stats(visitor, root=None): 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) |