From 61d89aae11efa2ac3ddfb1ca0c9e2d9c3477a82d Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Tue, 10 Dec 2019 12:09:48 +0100 Subject: [PATCH] completes #12799, fixes #12216 (#12870) --- compiler/cgen.nim | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/cgen.nim b/compiler/cgen.nim index 3982f60cc8..389c5a70cf 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -539,6 +539,7 @@ proc assignGlobalVar(p: BProc, n: PNode; value: Rope) = decl.addf "NIM_ALIGN($1) ", [rope(s.alignment)] if p.hcrOn: decl.add("static ") elif sfImportc in s.flags: decl.add("extern ") + if s.kind == skLet and value != nil: decl.add("NIM_CONST ") decl.add(td) if p.hcrOn: decl.add("*") if sfRegister in s.flags: decl.add(" register")