diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-12-12 16:29:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-12 16:29:46 +0100 |
commit | a1bf9fd2b6525e613899c5dc0380fb80021ee3e7 (patch) | |
tree | d2bdb332c973d2f6d43391369229cc732642c74d /compiler/semexprs.nim | |
parent | a38f35359738534ba856d02f3564d5fbc2dfc822 (diff) | |
parent | 070bcf4cea28a3238089379f5884787b2084b2de (diff) | |
download | Nim-a1bf9fd2b6525e613899c5dc0380fb80021ee3e7.tar.gz |
Merge branch 'devel' into sorted_deduplicate
Diffstat (limited to 'compiler/semexprs.nim')
-rw-r--r-- | compiler/semexprs.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 08917cb29..ddec457a1 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1083,6 +1083,8 @@ proc semSym(c: PContext, n: PNode, sym: PSym, flags: TExprFlags): PNode = # XXX see the hack in sigmatch.nim ... return s.typ.n elif sfGenSym in s.flags: + # the owner should have been set by now by addParamOrResult + internalAssert c.config, s.owner != nil if c.p.wasForwarded: # gensym'ed parameters that nevertheless have been forward declared # need a special fixup: @@ -2289,6 +2291,8 @@ proc semBlock(c: PContext, n: PNode; flags: TExprFlags): PNode = var labl = newSymG(skLabel, n.sons[0], c) if sfGenSym notin labl.flags: addDecl(c, labl) + elif labl.owner == nil: + labl.owner = c.p.owner n.sons[0] = newSymNode(labl, n.sons[0].info) suggestSym(c.config, n.sons[0].info, labl, c.graph.usageSym) styleCheckDef(c.config, labl) |