fixes #411
This commit is contained in:
parent
0715496d72
commit
c093139494
1 changed files with 12 additions and 8 deletions
|
|
@ -1934,6 +1934,10 @@ proc expr(p: BProc, n: PNode, d: var TLoc) =
|
||||||
of nkProcDef, nkMethodDef, nkConverterDef:
|
of nkProcDef, nkMethodDef, nkConverterDef:
|
||||||
if (n.sons[genericParamsPos].kind == nkEmpty):
|
if (n.sons[genericParamsPos].kind == nkEmpty):
|
||||||
var prc = n.sons[namePos].sym
|
var prc = n.sons[namePos].sym
|
||||||
|
# due to a bug/limitation in the lambda lifting, unused inner procs
|
||||||
|
# are not transformed correctly. We work around this issue (#411) here
|
||||||
|
# by ensuring it's no inner proc (owner is a module):
|
||||||
|
if prc.owner.kind == skModule:
|
||||||
if (optDeadCodeElim notin gGlobalOptions and
|
if (optDeadCodeElim notin gGlobalOptions and
|
||||||
sfDeadCodeElim notin getModule(prc).flags) or
|
sfDeadCodeElim notin getModule(prc).flags) or
|
||||||
({sfExportc, sfCompilerProc} * prc.flags == {sfExportc}) or
|
({sfExportc, sfCompilerProc} * prc.flags == {sfExportc}) or
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue