From 7731de96a854961fe2cf14d17f06b061254e0c8c Mon Sep 17 00:00:00 2001 From: metagn <10591326+metagn@users.noreply.github.com> Date: Sun, 24 Dec 2023 02:59:11 +0300 Subject: [PATCH] fix IC --- compiler/ic/dce.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/ic/dce.nim b/compiler/ic/dce.nim index 6eb36431ea040..f91c6ca8bae48 100644 --- a/compiler/ic/dce.nim +++ b/compiler/ic/dce.nim @@ -130,8 +130,10 @@ proc aliveCode(c: var AliveContext; g: PackedModuleGraph; tree: PackedTree; n: N of nkChckRangeF, nkChckRange64, nkChckRange: rangeCheckAnalysis(c, g, tree, n) of nkProcDef, nkConverterDef, nkMethodDef, nkFuncDef, nkIteratorDef: - if n.firstSon.kind == nkSym and isNotGeneric(n): - let item = tree[n.firstSon].soperand + var name = n.firstSon + if name.kind == nkPostfix: name = tree.ithSon(name, 1) + if name.kind == nkSym and isNotGeneric(n): + let item = tree[name].soperand if isExportedToC(c, g, item): # This symbol is alive and everything its body references. followLater(c, g, c.thisModule, item)