From f6b67f24a3cfffbf9d30871daec552c6e624e55c Mon Sep 17 00:00:00 2001 From: Andrew Porter Date: Wed, 15 Jan 2025 14:37:35 +0000 Subject: [PATCH] #2845 ensure consistent symbol table used --- src/psyclone/psyir/symbols/symbol_table.py | 5 +++++ src/psyclone/psyir/transformations/inline_trans.py | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/psyclone/psyir/symbols/symbol_table.py b/src/psyclone/psyir/symbols/symbol_table.py index d3e09158e4..6d388ba731 100644 --- a/src/psyclone/psyir/symbols/symbol_table.py +++ b/src/psyclone/psyir/symbols/symbol_table.py @@ -1625,6 +1625,11 @@ def resolve_imports(self, container_symbols=None, symbol_target=None): # TODO #11: It would be useful to log this. continue + if not external_container: + # Failed to get a Container (possibly due to parsing or raising + # errors). + continue + # Examine all Symbols defined within this external container for symbol in external_container.symbol_table.symbols: if symbol.visibility == Symbol.Visibility.PRIVATE: diff --git a/src/psyclone/psyir/transformations/inline_trans.py b/src/psyclone/psyir/transformations/inline_trans.py index 5fa4b35228..a0892a31ea 100644 --- a/src/psyclone/psyir/transformations/inline_trans.py +++ b/src/psyclone/psyir/transformations/inline_trans.py @@ -212,7 +212,6 @@ def apply(self, node, options=None): for child in new_stmts: idx += 1 parent.addchild(child, idx) - table = parent.scope.symbol_table # Avoid a potential name clash with the original function table.rename_symbol( routine.return_symbol, table.next_available_name(