summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-01-12 15:08:02 +0100
committerAraq <rumpf_a@web.de>2018-01-12 15:08:02 +0100
commitf1bf65f66e8bc3acb0afea4699a48c514189d355 (patch)
tree30f43f05b16f11eedd4e44bf6eaaff1e1f1285b7
parent3647c9c8222f2bfecf88d56403455e56084634f9 (diff)
downloadNim-f1bf65f66e8bc3acb0afea4699a48c514189d355.tar.gz
gc.nim: Add a gcAssert to enforce the no heap sharing restrictions
-rw-r--r--lib/system/gc.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/system/gc.nim b/lib/system/gc.nim
index dac06119d..a0c943c35 100644
--- a/lib/system/gc.nim
+++ b/lib/system/gc.nim
@@ -639,6 +639,7 @@ when useMarkForDebug or useBackupGc:
     while gch.tempStack.len > 0:
       dec gch.tempStack.len
       var d = gch.tempStack.d[gch.tempStack.len]
+      gcAssert isAllocatedPtr(gch.region, d), "markS: foreign heap root detected!"
       if not containsOrIncl(gch.marked, d):
         forAllChildren(d, waMarkPrecise)