diff --git a/slither/solc_parsing/yul/parse_yul.py b/slither/solc_parsing/yul/parse_yul.py index 0c7b48091..f303647ce 100644 --- a/slither/solc_parsing/yul/parse_yul.py +++ b/slither/solc_parsing/yul/parse_yul.py @@ -35,6 +35,7 @@ from slither.solc_parsing.yul.evm_functions import ( unary_ops, binary_ops, ) +from slither.solc_parsing.expressions.find_variable import _find_top_level from slither.visitors.expression.find_calls import FindCalls from slither.visitors.expression.read_var import ReadVar from slither.visitors.expression.write_var import WriteVar @@ -797,6 +798,10 @@ def parse_yul_identifier(root: YulScope, _node: YulNode, ast: Dict) -> Optional[ if magic_suffix: return magic_suffix + ret, _ = _find_top_level(name, root._contract.file_scope) + if ret: + return Identifier(ret) + raise SlitherException(f"unresolved reference to identifier {name}")