From d7ad10159353a73a655e6f6aefbd34a2e55cd0f1 Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 6 Dec 2025 23:11:36 +0100 Subject: [PATCH] bugfix --- compiler/ast2nif.nim | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/compiler/ast2nif.nim b/compiler/ast2nif.nim index f77747fba5..1e730eb06e 100644 --- a/compiler/ast2nif.nim +++ b/compiler/ast2nif.nim @@ -1436,10 +1436,15 @@ proc tryResolveCompilerProc*(c: var DecodeContext; name: string; moduleFileIdx: if offs.offset == 0: return nil - # Get or create the SymId for this symbol name - let symId = pool.syms.getOrIncl(symName) - # Now resolve it - this will create the PSym stub - result = resolveHookSym(c, symId) + # Create a stub symbol + let val = addr c.mods[module].symCounter + inc val[] + let id = ItemId(module: int32(module), item: val[]) + result = c.syms.getOrDefault(id)[0] + if result == nil: + result = PSym(itemId: id, kindImpl: skProc, name: c.cache.getIdent(name), + disamb: 0, state: Partial) + c.syms[id] = (result, offs) proc loadNifModule*(c: var DecodeContext; f: FileIndex; interf, interfHidden: var TStrTable; hooks: var Table[nifstreams.SymId, HooksPerType];