From 443a26dc7f8710d6f1539d7c607eabf425b1140e Mon Sep 17 00:00:00 2001 From: chaoticgd <43898262+chaoticgd@users.noreply.github.com> Date: Wed, 7 Feb 2024 01:54:17 +0000 Subject: [PATCH] Fix NodeHandle::lookup_node --- src/ccc/symbol_database.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ccc/symbol_database.cpp b/src/ccc/symbol_database.cpp index 8bbefbf..d2b598f 100644 --- a/src/ccc/symbol_database.cpp +++ b/src/ccc/symbol_database.cpp @@ -891,9 +891,11 @@ const MultiSymbolHandle& NodeHandle::symbol() const const ast::Node* NodeHandle::lookup_node(const SymbolDatabase& database) const { - const Symbol* symbol = m_symbol.lookup_symbol(database); - if(!symbol || symbol->generation() != m_generation) { - return nullptr; + if(m_symbol.valid()) { + const Symbol* symbol = m_symbol.lookup_symbol(database); + if(!symbol || symbol->generation() != m_generation) { + return nullptr; + } } return m_node; }