summary refs log tree commit diff stats
path: root/compiler/ccgexprs.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-09-05 11:56:32 +0200
committerGitHub <noreply@github.com>2019-09-05 11:56:32 +0200
commita5e2db2ac53aa61d0e050ee6487e38c647eb442d (patch)
tree5544badb2d7ad8da252e16386bdf27998d076161 /compiler/ccgexprs.nim
parent58bcf6cd46fe9108f2dced59c612153d2951aee2 (diff)
downloadNim-a5e2db2ac53aa61d0e050ee6487e38c647eb442d.tar.gz
allows access to .compileTime vars at runtime (#12128)
Diffstat (limited to 'compiler/ccgexprs.nim')
-rw-r--r--compiler/ccgexprs.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index 0902e2e19..253c67b24 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -2533,6 +2533,9 @@ proc expr(p: BProc, n: PNode, d: var TLoc) =
     of skVar, skForVar, skResult, skLet:
       if {sfGlobal, sfThread} * sym.flags != {}:
         genVarPrototype(p.module, n)
+        if sfCompileTime in sym.flags:
+          genSingleVar(p, sym, n, astdef(sym))
+
       if sym.loc.r == nil or sym.loc.t == nil:
         #echo "FAILED FOR PRCO ", p.prc.name.s
         #echo renderTree(p.prc.ast, {renderIds})