proper order of initialization for .global. variables
This commit is contained in:
parent
e941a14767
commit
a64f03230a
7 changed files with 62 additions and 3 deletions
|
|
@ -53,7 +53,7 @@ proc genSingleVar(p: BProc, a: PNode) =
|
|||
var targetProc = p
|
||||
var immediateAsgn = a.sons[2].kind != nkEmpty
|
||||
if sfGlobal in v.flags:
|
||||
targetProc = p.module.initProc
|
||||
targetProc = p.module.preInitProc
|
||||
assignGlobalVar(targetProc, v)
|
||||
genObjectInit(targetProc, cpsInit, v.typ, v.loc, true)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue