tracer: return default name on unrecognized opcode.
The default name is more commonly returned on code such as: x, y = Signal(), Signal() The case where the opcode is not recognized is only encountered when older Amaranth is ran on a newer Python interpreter (with more opcodes). Returning None instead of a name here caused issues in the RTLIL backend, which would incorrectly use $\d+ names for ports, since the RTLIL backend assumed the name of a signal is always a string. Fixes #733.
This commit is contained in:
parent
2ca421dea8
commit
aaec7e0d27
|
@ -24,8 +24,9 @@ def get_var_name(depth=2, default=_raise_exception):
|
||||||
call_index += 2
|
call_index += 2
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
if call_opc not in ("CALL_FUNCTION", "CALL_FUNCTION_KW", "CALL_FUNCTION_EX", "CALL_METHOD", "CALL"):
|
if call_opc not in ("CALL_FUNCTION", "CALL_FUNCTION_KW", "CALL_FUNCTION_EX",
|
||||||
return None
|
"CALL_METHOD", "CALL"):
|
||||||
|
return default
|
||||||
|
|
||||||
index = call_index + 2
|
index = call_index + 2
|
||||||
while True:
|
while True:
|
||||||
|
|
Loading…
Reference in a new issue