Skip to content

Commit d7ad101

Browse files
committed
bugfix
1 parent 8c42341 commit d7ad101

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

compiler/ast2nif.nim

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,10 +1436,15 @@ proc tryResolveCompilerProc*(c: var DecodeContext; name: string; moduleFileIdx:
14361436
if offs.offset == 0:
14371437
return nil
14381438

1439-
# Get or create the SymId for this symbol name
1440-
let symId = pool.syms.getOrIncl(symName)
1441-
# Now resolve it - this will create the PSym stub
1442-
result = resolveHookSym(c, symId)
1439+
# Create a stub symbol
1440+
let val = addr c.mods[module].symCounter
1441+
inc val[]
1442+
let id = ItemId(module: int32(module), item: val[])
1443+
result = c.syms.getOrDefault(id)[0]
1444+
if result == nil:
1445+
result = PSym(itemId: id, kindImpl: skProc, name: c.cache.getIdent(name),
1446+
disamb: 0, state: Partial)
1447+
c.syms[id] = (result, offs)
14431448

14441449
proc loadNifModule*(c: var DecodeContext; f: FileIndex; interf, interfHidden: var TStrTable;
14451450
hooks: var Table[nifstreams.SymId, HooksPerType];

0 commit comments

Comments
 (0)