diff options
Diffstat (limited to 'compiler/cgen.nim')
-rw-r--r-- | compiler/cgen.nim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim index 8c85db2f8..b332c6cd7 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -2180,7 +2180,10 @@ proc finalCodegenActions*(graph: ModuleGraph; m: BModule; n: PNode): PNode = if m.hcrOn: # make sure this is pulled in (meaning hcrGetGlobal() is called for it during init) - cgsym(m, "programResult") + let sym = magicsys.getCompilerProc(m.g.graph, "programResult") + # ignore when not available, could be a module imported early in `system` + if sym != nil: + cgsymImpl m, sym if m.inHcrInitGuard: endBlock(m.initProc) |