summary refs log tree commit diff stats
path: root/compiler/ccgexprs.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2020-01-17 17:51:34 +0100
committerAraq <rumpf_a@web.de>2020-01-17 17:52:06 +0100
commit107352f9d76904d24838c9342e57fea9eba57442 (patch)
treeb09320d3ea53c3b87b0eaf9661f7fd02745c7c2b /compiler/ccgexprs.nim
parent6c2214b7def63b275837b3acc5a635994022f6ac (diff)
downloadNim-107352f9d76904d24838c9342e57fea9eba57442.tar.gz
fixes #13157
Diffstat (limited to 'compiler/ccgexprs.nim')
-rw-r--r--compiler/ccgexprs.nim9
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index 87a936048..e52be902b 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -2178,7 +2178,10 @@ proc genMagicExpr(p: BProc, e: PNode, d: var TLoc, op: TMagic) =
   of mNew: genNew(p, e)
   of mNewFinalize:
     if optTinyRtti in p.config.globalOptions:
-      genNew(p, e)
+      var a: TLoc
+      initLocExpr(p, e[1], a)
+      rawGenNew(p, a, nil)
+      gcUsage(p.config, e)
     else:
       genNewFinalize(p, e)
   of mNewSeq: genNewSeq(p, e)
@@ -2747,9 +2750,9 @@ proc getDefaultValue(p: BProc; typ: PType; info: TLineInfo): Rope =
       result = rope"{NIM_NIL, NIM_NIL}"
   of tyObject:
     var count = 0
-    result.add "{" 
+    result.add "{"
     getNullValueAuxT(p, t, t, t.n, nil, result, count, true, info)
-    result.add "}" 
+    result.add "}"
   of tyTuple:
     result = rope"{"
     for i in 0..<t.len: