fixes #3995
This commit is contained in:
parent
e2671aa401
commit
5757ad858c
3 changed files with 38 additions and 4 deletions
|
|
@ -1856,10 +1856,16 @@ proc genClosure(p: BProc, n: PNode, d: var TLoc) =
|
|||
initLocExpr(p, n.sons[1], b)
|
||||
if n.sons[0].skipConv.kind == nkClosure:
|
||||
internalError(n.info, "closure to closure created")
|
||||
getTemp(p, n.typ, tmp)
|
||||
linefmt(p, cpsStmts, "$1.ClPrc = $2; $1.ClEnv = $3;$n",
|
||||
tmp.rdLoc, a.rdLoc, b.rdLoc)
|
||||
putLocIntoDest(p, d, tmp)
|
||||
# tasyncawait.nim breaks with this optimization:
|
||||
when false:
|
||||
if d.k != locNone:
|
||||
linefmt(p, cpsStmts, "$1.ClPrc = $2; $1.ClEnv = $3;$n",
|
||||
d.rdLoc, a.rdLoc, b.rdLoc)
|
||||
else:
|
||||
getTemp(p, n.typ, tmp)
|
||||
linefmt(p, cpsStmts, "$1.ClPrc = $2; $1.ClEnv = $3;$n",
|
||||
tmp.rdLoc, a.rdLoc, b.rdLoc)
|
||||
putLocIntoDest(p, d, tmp)
|
||||
|
||||
proc genArrayConstr(p: BProc, n: PNode, d: var TLoc) =
|
||||
var arr: TLoc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue