* Fix #14160

* Add testcase
This commit is contained in:
Clyybber
2020-04-30 02:01:07 +02:00
committed by GitHub
parent bd57f0cd32
commit d6e1b5c070
2 changed files with 22 additions and 1 deletions

15
tests/ccgbugs/t14160.nim Normal file
View File

@@ -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()