summary refs log tree commit diff stats
path: root/tests/ccgbugs
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2021-03-11 14:03:25 +0100
committerGitHub <noreply@github.com>2021-03-11 14:03:25 +0100
commit3cbc80045dfe84e47e28abc4d19f2bbeba82748d (patch)
tree5f77f08131e2a090c4788e1e28a98b61cea30f2c /tests/ccgbugs
parent3ce27511adac12785b51ecc33dc9d2a2fcd2f0b8 (diff)
downloadNim-3cbc80045dfe84e47e28abc4d19f2bbeba82748d.tar.gz
Fix #14325 (#17308)
* Fix #14325
* Refactor and fix
Diffstat (limited to 'tests/ccgbugs')
-rw-r--r--tests/ccgbugs/tlvalueconv.nim (renamed from tests/ccgbugs/t14160.nim)17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ccgbugs/t14160.nim b/tests/ccgbugs/tlvalueconv.nim
index be7088e29..b2cb11eef 100644
--- a/tests/ccgbugs/t14160.nim
+++ b/tests/ccgbugs/tlvalueconv.nim
@@ -1,3 +1,9 @@
+discard """
+  matrix: "--gc:refc; --gc:arc"
+"""
+
+# bug #14160
+
 type
   TPassContext = object of RootObj
   PPassContext = ref TPassContext
@@ -11,5 +17,16 @@ type
 proc main() =
   var g = ModuleGraph(vm: new(Pctx))
   PCtx(g.vm) = nil #This generates invalid C code
+  doAssert g.vm == nil
 
 main()
+
+# bug #14325
+
+proc main2() =
+  var g = ModuleGraph(vm: new(Pctx))
+  PPassContext(PCtx(g.vm)) = nil #This compiles, but crashes at runtime with gc:arc
+  doAssert g.vm == nil
+
+main2()
+