summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2019-01-27 09:34:54 +0000
committerAndreas Sandberg <andreas.sandberg@arm.com>2019-03-01 17:38:42 +0000
commitaf9496b1f21021a4b431da665c027b521a2de17d (patch)
tree03412dec4f3171e10a635e04a701a88c99ced40e /src
parent96cc03f90db82fa8f84248ef478362267dba292c (diff)
downloadgem5-af9496b1f21021a4b431da665c027b521a2de17d.tar.xz
python: Fix issue when Self proxy resolves to a another proxy
The problem occurs when a proxy is being resolved to another proxy that hasn't been resolved yet. The problematic case that was triggering this issues in the VGIC. It was caused by parameters looking a bit like this: gic = Param.GicV2(Parent.any) some_param = Param.Int(Self.gic.some_param) When 'some_param' was resolved, it found the 'gic' parameter in Self. However, that parameter hadn't been resolved yet, so the existing code was setting the proxy evaluation context to the unresolved Parent.any proxy without first unproxying it. It seems like this bug depends on the graph traversal order and I have so far only seen it when compiling gem5 with Python 3. Change-Id: Iea12cc138765e70bfd6bb776b1efa012364db066 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/16004 Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src')
-rw-r--r--src/python/m5/proxy.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/python/m5/proxy.py b/src/python/m5/proxy.py
index 5128156df..d28954555 100644
--- a/src/python/m5/proxy.py
+++ b/src/python/m5/proxy.py
@@ -187,13 +187,15 @@ class AttrProxy(BaseProxy):
if hasattr(val, '_visited'):
visited = getattr(val, '_visited')
- if not visited:
+ if visited:
+ return None, False
+
+ if not isproxy(val):
# for any additional unproxying to be done, pass the
# current, rather than the original object so that proxy
# has the right context
obj = val
- else:
- return None, False
+
except:
return None, False
while isproxy(val):