summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-01-22 12:27:44 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-01-23 22:03:15 +0100
commit400b4e4e0ea33ef3d7ad94c503c5e00001dec536 (patch)
tree389e1349209380240131b3590b81ac8d24b06291 /compiler
parent35d96d8749809863bbbb6ead1e8cf887a95a94e5 (diff)
downloadNim-400b4e4e0ea33ef3d7ad94c503c5e00001dec536.tar.gz
improve the generated code size for --gc:regions
Diffstat (limited to 'compiler')
-rw-r--r--compiler/cgen.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim
index 190814b79..78f9e72da 100644
--- a/compiler/cgen.nim
+++ b/compiler/cgen.nim
@@ -321,7 +321,7 @@ proc resetLoc(p: BProc, loc: var TLoc) =
   else:
     if optNilCheck in p.options:
       linefmt(p, cpsStmts, "#chckNil((void*)$1);$n", addrLoc(p.config, loc))
-    if loc.storage != OnStack:
+    if loc.storage != OnStack and containsGcRef:
       linefmt(p, cpsStmts, "#genericReset((void*)$1, $2);$n",
               addrLoc(p.config, loc), genTypeInfo(p.module, loc.t, loc.lode.info))
       # XXX: generated reset procs should not touch the m_type