* fixes #12899 * fixes regression: destroy global variables in reverse declaration order, closureleak test relies on it
This commit is contained in:
parent
f9f55a23bb
commit
3f6df5cc34
5 changed files with 45 additions and 15 deletions
|
|
@ -1981,8 +1981,8 @@ proc myClose(graph: ModuleGraph; b: PPassContext, n: PNode): PNode =
|
|||
if b == nil: return
|
||||
var m = BModule(b)
|
||||
if sfMainModule in m.module.flags:
|
||||
for destructorCall in graph.globalDestructors:
|
||||
n.add destructorCall
|
||||
for i in countdown(high(graph.globalDestructors), 0):
|
||||
n.add graph.globalDestructors[i]
|
||||
if passes.skipCodegen(m.config, n): return
|
||||
if moduleHasChanged(graph, m.module):
|
||||
# if the module is cached, we don't regenerate the main proc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue