summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-08-31 19:04:32 +0800
committerGitHub <noreply@github.com>2023-08-31 19:04:32 +0800
commit5bd1afc3f9716fed833b7bd251ee45479b78a950 (patch)
tree6187573153e3590c9030b99d7707a9bbb40f49db /compiler
parentdfb3a88cc3a077b452c90e63af3dec21ba822181 (diff)
downloadNim-5bd1afc3f9716fed833b7bd251ee45479b78a950.tar.gz
fixes #17197; fixes #22560; fixes the dest of newSeqOfCap in refc (#22594)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgexprs.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index 2492eebae..8bd0b8721 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -1468,6 +1468,7 @@ proc genNewSeqOfCap(p: BProc; e: PNode; d: var TLoc) =
       getSeqPayloadType(p.module, seqtype),
     ])
   else:
+    if d.k == locNone: d = getTemp(p, e.typ, needsInit=false) # bug #22560
     putIntoDest(p, d, e, ropecg(p.module,
                 "($1)#nimNewSeqOfCap($2, $3)", [
                 getTypeDesc(p.module, seqtype),