summary refs log tree commit diff stats
path: root/lib/system/gc_ms.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-04-30 01:05:52 +0200
committerAraq <rumpf_a@web.de>2014-04-30 01:05:52 +0200
commit81d404979780386ecd1756a41dfc09497e194f26 (patch)
tree7129980de994f3de36343bce234a7973ca47d99a /lib/system/gc_ms.nim
parentbd705a517f51d96300c35761d78c3f4c3ff50686 (diff)
downloadNim-81d404979780386ecd1756a41dfc09497e194f26.tar.gz
bugfix: MS-GC GC_unref
Diffstat (limited to 'lib/system/gc_ms.nim')
-rw-r--r--lib/system/gc_ms.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/system/gc_ms.nim b/lib/system/gc_ms.nim
index db437b8d0..410243528 100644
--- a/lib/system/gc_ms.nim
+++ b/lib/system/gc_ms.nim
@@ -143,7 +143,7 @@ proc nimGCref(p: pointer) {.compilerProc.} =
 
 proc nimGCunref(p: pointer) {.compilerProc.} =
   let cell = usrToCell(p)
-  var L = gch.additionalRoots.len
+  var L = gch.additionalRoots.len-1
   var i = L
   let d = gch.additionalRoots.d
   while i >= 0:
@@ -151,6 +151,7 @@ proc nimGCunref(p: pointer) {.compilerProc.} =
       d[i] = d[L]
       dec gch.additionalRoots.len
       break
+    dec(i)
   when false:
     when withBitvectors: incl(gch.allocated, usrToCell(p))
     else: usrToCell(p).refcount = rcWhite