summary refs log tree commit diff stats
path: root/tests/ccgbugs
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2020-04-30 02:01:07 +0200
committerGitHub <noreply@github.com>2020-04-30 02:01:07 +0200
commitd6e1b5c070bf58449bf4af210ec099418d496aa5 (patch)
treec51d54904abc29c8cdad0c1d3f5417b04d9a11ab /tests/ccgbugs
parentbd57f0cd3268843808c52614864a609703d9e611 (diff)
downloadNim-d6e1b5c070bf58449bf4af210ec099418d496aa5.tar.gz
Fix #14160 (#14161)
* Fix #14160

* Add testcase
Diffstat (limited to 'tests/ccgbugs')
-rw-r--r--tests/ccgbugs/t14160.nim15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ccgbugs/t14160.nim b/tests/ccgbugs/t14160.nim
new file mode 100644
index 000000000..be7088e29
--- /dev/null
+++ b/tests/ccgbugs/t14160.nim
@@ -0,0 +1,15 @@
+type
+  TPassContext = object of RootObj
+  PPassContext = ref TPassContext
+
+  PCtx = ref object of TPassContext
+    a: int
+
+  ModuleGraph = object
+    vm: RootRef
+
+proc main() =
+  var g = ModuleGraph(vm: new(Pctx))
+  PCtx(g.vm) = nil #This generates invalid C code
+
+main()