diff --git a/compiler/modulegraphs.nim b/compiler/modulegraphs.nim index 0aedfa1b26..8f13e4d516 100644 --- a/compiler/modulegraphs.nim +++ b/compiler/modulegraphs.nim @@ -536,6 +536,7 @@ proc initModuleGraphFields(result: ModuleGraph) = result.operators = initOperators(result) result.emittedTypeInfo = initTable[string, FileIndex]() result.cachedFiles = newStringTable() + result.cachedMods = initIntSet() proc newModuleGraph*(cache: IdentCache; config: ConfigRef): ModuleGraph = result = ModuleGraph() @@ -677,6 +678,9 @@ when not defined(nimKochBootstrap): g.ifaces[fileIdx.int].interfHidden, flags) result.module = m + # Mark module as cached + g.cachedMods.incl fileIdx.int + # Register hooks from NIF index with the module graph for x in result.logOps: case x.kind