summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2020-11-02 17:27:48 +0800
committerGitHub <noreply@github.com>2020-11-02 10:27:48 +0100
commit558115fa2906abeda11e6fd128ac139e9aac1838 (patch)
tree87ed3a89ca7e3fdf330f9b84bd2cac149b97f4be /compiler
parent919593395c7325ffd1cb93fb787c2772da2195f0 (diff)
downloadNim-558115fa2906abeda11e6fd128ac139e9aac1838.tar.gz
fixes #15717
Diffstat (limited to 'compiler')
-rw-r--r--compiler/vmgen.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim
index f084ab7ba..0c0c491e0 100644
--- a/compiler/vmgen.nim
+++ b/compiler/vmgen.nim
@@ -683,6 +683,8 @@ proc genNewSeq(c: PCtx; n: PNode) =
 
 proc genNewSeqOfCap(c: PCtx; n: PNode; dest: var TDest) =
   let t = n.typ
+  if dest < 0:
+    dest = c.getTemp(n.typ)
   let tmp = c.getTemp(n[1].typ)
   c.gABx(n, opcLdNull, dest, c.genType(t))
   c.gABx(n, opcLdImmInt, tmp, 0)