Skip to content

Commit

Permalink
IC: codegen: fix (nim-lang#17931)
Browse files Browse the repository at this point in the history
  • Loading branch information
Araq authored May 4, 2021
1 parent 01f316c commit d67ae4a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/ccgexprs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit d67ae4a

Please sign in to comment.