diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2021-05-04 07:03:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-04 07:03:00 +0200 |
commit | d67ae4afa688f02059b83e59a7f19a8a8030272b (patch) | |
tree | 9376fcb2b46c562ad9324180d4421608d6d0a3fe | |
parent | 01f316cf1f34fc23cd2a7df7ee84fe85215e70d6 (diff) | |
download | Nim-d67ae4afa688f02059b83e59a7f19a8a8030272b.tar.gz |
IC: codegen: fix (#17931)
-rw-r--r-- | compiler/ccgexprs.nim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index a42c30aae..b5ad24cc1 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -2640,7 +2640,9 @@ proc genConstSetup(p: BProc; sym: PSym): bool = result = lfNoDecl notin sym.loc.flags proc genConstHeader(m, q: BModule; p: BProc, sym: PSym) = - assert(sym.loc.r != nil) + if sym.loc.r == nil: + if not genConstSetup(p, sym): return + assert(sym.loc.r != nil, $sym.name.s & $sym.itemId) if m.hcrOn: m.s[cfsVars].addf("static $1* $2;$n", [getTypeDesc(m, sym.loc.t, skVar), sym.loc.r]); m.initProc.procSec(cpsLocals).addf( |