From dd3b47a470b4ac93c903e2926fd0a9e58c4a738b Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Tue, 28 Apr 2026 12:40:15 +0200 Subject: [PATCH] simplify: fix fast lookup for packages --- frontends/ast/simplify.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index d90ade3fe..55626d101 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -4862,10 +4862,10 @@ void AstNode::add_to_module_fast_lookup(dict& module_fast dict AstNode::generate_module_fast_lookup_for_genblock_expansion() { dict module_fast_lookup; - if (current_ast_mod) { - for (auto& node : current_ast_mod->children) { - add_to_module_fast_lookup(module_fast_lookup, node.get()); - } + AstNode *current_scope_ast = (current_ast_mod == nullptr) ? current_ast : current_ast_mod; + log_assert(current_scope_ast); + for (auto& node : current_scope_ast->children) { + add_to_module_fast_lookup(module_fast_lookup, node.get()); } return module_fast_lookup; }