summary refs log tree commit diff stats
path: root/lib/system
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-08-09 00:25:31 +0200
committerAraq <rumpf_a@web.de>2013-08-09 00:25:31 +0200
commitdb027faf38a47365988962b25086231e6791bb35 (patch)
treecdc8d94f8c67e8ac04bdb566af5a1ea439b49cd3 /lib/system
parenta294d45fd67cebec8dd0efc43417fdc2ad1030dc (diff)
downloadNim-db027faf38a47365988962b25086231e6791bb35.tar.gz
fixes a long standing channels bug
Diffstat (limited to 'lib/system')
-rw-r--r--lib/system/channels.nim2
-rw-r--r--lib/system/gc.nim2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/system/channels.nim b/lib/system/channels.nim
index 89f742ca5..f5bcdec03 100644
--- a/lib/system/channels.nim
+++ b/lib/system/channels.nim
@@ -143,7 +143,7 @@ proc storeAux(dest, src: Pointer, mt: PNimType, t: PRawChannel,
         # XXX we should use the dynamic type here too, but that is not stored

         # in the inbox at all --> use source[]'s object type? but how? we need

         # a tyRef to the object!

-        var obj = newObj(mt.base, mt.base.size)

+        var obj = newObj(mt, mt.base.size)

         unsureAsgnRef(x, obj)

       storeAux(x[], s, mt.base, t, mode)

       if mode != mStore: Dealloc(t.region, s)

diff --git a/lib/system/gc.nim b/lib/system/gc.nim
index 0ab5f4d94..cb264fe0d 100644
--- a/lib/system/gc.nim
+++ b/lib/system/gc.nim
@@ -90,6 +90,8 @@ template gcAssert(cond: bool, msg: string) =
   when defined(useGcAssert):
     if not cond:
       echo "[GCASSERT] ", msg
+      GC_disable()
+      writeStackTrace()
       quit 1
 
 proc addZCT(s: var TCellSeq, c: PCell) {.noinline.} =