Fixes 8535 (#8591)

* Goodbye postInitProc

* Give preInitProc its own scope

Avoid any conflict between the variables introduced by preInitProc and
initProc since both are codegen'd in the same function body.

* Fix codegen for global var init in emulated TLS

Fixes #8535

* Add test for #8535

* Keep a bogus stack frame around

* Remove more dead code
This commit is contained in:
LemonBoy 2018-08-17 00:34:27 +02:00 • committed by Andreas Rumpf
commit ac0f5c83ca
4 changed files with 45 additions and 16 deletions

16
tests/threads/t8535.nim Normal file
View file

@ -0,0 +1,16 @@
discard """
output: "0"
"""
type
CircAlloc* [Size: static[int] , T] = tuple
baseArray : array[Size,T]
index : uint16
type
Job = object of RootObj
var foo {.threadvar.}: CircAlloc[1,Job]
when isMainModule:
echo foo.index