summary refs log tree commit diff stats
path: root/lib/core
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-04-26 20:33:58 +0200
committerAraq <rumpf_a@web.de>2019-04-26 20:33:58 +0200
commit8e27bddb97cb5629c35807c81ead3da58a09ebcc (patch)
treeb4ad2acbebc7a915175fd61f60d4bdb5350dcbd1 /lib/core
parentb350a9fc52d67cabc778887d8f81d0332eb9db91 (diff)
downloadNim-8e27bddb97cb5629c35807c81ead3da58a09ebcc.tar.gz
newruntime: make 'discard new RootObj' work
Diffstat (limited to 'lib/core')
-rw-r--r--lib/core/runtime_v2.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/core/runtime_v2.nim b/lib/core/runtime_v2.nim
index 8a1e45741..0165833b4 100644
--- a/lib/core/runtime_v2.nim
+++ b/lib/core/runtime_v2.nim
@@ -48,7 +48,7 @@ proc nimNewObj(size: int): pointer {.compilerRtl.} =
     discard
   elif defined(useMalloc):
     var orig = c_malloc(s)
-    nimZeroMem(result, s)
+    nimZeroMem(orig, s)
     result = orig +! sizeof(RefHeader)
   else:
     result = alloc0(s) +! sizeof(RefHeader)