projects
/
nmigen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b304531
)
tracer: fix get_var_name() to work on toplevel attributes.
author
whitequark
<whitequark@whitequark.org>
Mon, 4 May 2020 05:51:08 +0000
(
05:51
+0000)
committer
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Fri, 31 Dec 2021 13:30:45 +0000
(13:30 +0000)
E.g. this now works:
>>> class dummy: pass
>>> self = dummy()
>>> self.foo = Signal()
>>> self.foo.name
'foo'
nmigen/tracer.py
patch
|
blob
|
history
diff --git
a/nmigen/tracer.py
b/nmigen/tracer.py
index f02ecd336046938a723f1fef502e76ff370cffb7..17795f3b30a31ec71307d09adf62615b34832f78 100644
(file)
--- a/
nmigen/tracer.py
+++ b/
nmigen/tracer.py
@@
-37,7
+37,7
@@
def get_var_name(depth=2, default=_raise_exception):
elif opc == "STORE_DEREF":
name_index = int(code.co_code[index + 1])
return code.co_cellvars[name_index]
- elif opc in ("LOAD_GLOBAL", "LOAD_ATTR", "LOAD_FAST", "LOAD_DEREF",
+ elif opc in ("LOAD_GLOBAL", "LOAD_
NAME", "LOAD_
ATTR", "LOAD_FAST", "LOAD_DEREF",
"DUP_TOP", "BUILD_LIST"):
index += 2
else: