config: Avoid generating a reference to myself for Parent.any
The unproxy code for Parent.any can generate a circular reference in certain situations with classes hierarchies like those in ClockDomain.py. This patch solves this by marking ouself as visited to make sure the search does not resolve to a self-reference.
This commit is contained in:
@@ -861,7 +861,11 @@ class SimObject(object):
|
||||
|
||||
found_obj = None
|
||||
for child in self._children.itervalues():
|
||||
if isinstance(child, ptype):
|
||||
visited = False
|
||||
if hasattr(child, '_visited'):
|
||||
visited = getattr(child, '_visited')
|
||||
|
||||
if isinstance(child, ptype) and not visited:
|
||||
if found_obj != None and child != found_obj:
|
||||
raise AttributeError, \
|
||||
'parent.any matched more than one: %s %s' % \
|
||||
|
||||
Reference in New Issue
Block a user