From 49a521371368b027fec92682b0a919c3edc4c8b4 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sat, 9 Feb 2019 08:18:33 +0100 Subject: [PATCH] fixes #10606 --- compiler/passes.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/passes.nim b/compiler/passes.nim index 50fc13e1e2..f45ee03f78 100644 --- a/compiler/passes.nim +++ b/compiler/passes.nim @@ -167,7 +167,9 @@ proc processModule*(graph: ModuleGraph; module: PSym, stream: PLLStream): bool { if graph.stopCompile(): break var n = parseTopLevelStmt(p) if n.kind == nkEmpty: break - if {sfNoForward, sfReorder} * module.flags != {}: + if sfSystemModule notin module.flags and + ({sfNoForward, sfReorder} * module.flags != {} or + codeReordering in graph.config.features): # read everything, no streaming possible var sl = newNodeI(nkStmtList, n.info) sl.add n @@ -175,7 +177,7 @@ proc processModule*(graph: ModuleGraph; module: PSym, stream: PLLStream): bool { var n = parseTopLevelStmt(p) if n.kind == nkEmpty: break sl.add n - if sfReorder in module.flags: + if sfReorder in module.flags or codeReordering in graph.config.features: sl = reorder(graph, sl, module) discard processTopLevelStmt(graph, sl, a) break