From adf250bf45c3e231fe02e6293356e0fb9450a470 Mon Sep 17 00:00:00 2001 From: Varun Gandhi Date: Thu, 15 Jun 2023 12:38:41 +0800 Subject: [PATCH] fix: Avoid assertion in asSymbolRef() --- scip_indexer/SCIPIndexer.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scip_indexer/SCIPIndexer.cc b/scip_indexer/SCIPIndexer.cc index 89573c961..cd4b265d1 100644 --- a/scip_indexer/SCIPIndexer.cc +++ b/scip_indexer/SCIPIndexer.cc @@ -924,8 +924,9 @@ class CFGTraversal final { auto [namedSym, _] = symRef.value(); auto check = isMethodFileStaticInit || - method == gs.lookupStaticInitForClass(namedSym.asSymbolRef().asClassOrModuleRef().data(gs)->owner, - /*allowMissing*/ true); + (namedSym.kind() != GenericSymbolRef::Kind::Field && + method == gs.lookupStaticInitForClass(namedSym.asSymbolRef().asClassOrModuleRef().data(gs)->owner, + /*allowMissing*/ true)); absl::Status status; string kind; if (check) {