Skip to content

Commit

Permalink
fix IC
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Dec 23, 2023
1 parent 1d5afd8 commit 7731de9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions compiler/ic/dce.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7731de9

Please sign in to comment.