summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-09-12 15:31:55 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-09-12 23:04:19 +0200
commit259daf98cf8bdb89e537014b56f6ad38b99956e5 (patch)
tree7751db1501aefed616e016d8a4148cf5259140b7
parent646a5694215ecdc1ba902ed40c7ee27fbc7a7b3e (diff)
downloadNim-259daf98cf8bdb89e537014b56f6ad38b99956e5.tar.gz
fixes thread vars of non-global visibility
-rw-r--r--compiler/ccgexprs.nim3
-rw-r--r--compiler/cgen.nim2
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index 0ba775b25..be49ddc87 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -1976,7 +1976,8 @@ proc expr(p: BProc, n: PNode, d: var TLoc) =
     of skEnumField:
       putIntoDest(p, d, n.typ, rope(sym.position))
     of skVar, skForVar, skResult, skLet:
-      if sfGlobal in sym.flags: genVarPrototype(p.module, sym)
+      if {sfGlobal, sfThread} * sym.flags != {}:
+        genVarPrototype(p.module, 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})
diff --git a/compiler/cgen.nim b/compiler/cgen.nim
index 48b6e9633..620ee4887 100644
--- a/compiler/cgen.nim
+++ b/compiler/cgen.nim
@@ -788,7 +788,7 @@ proc genProc(m: BModule, prc: PSym) =
           genProcAux(generatedHeader, prc)
 
 proc genVarPrototypeAux(m: BModule, sym: PSym) =
-  assert(sfGlobal in sym.flags)
+  #assert(sfGlobal in sym.flags)
   useHeader(m, sym)
   fillLoc(sym.loc, locGlobalVar, sym.typ, mangleName(sym), OnHeap)
   if (lfNoDecl in sym.loc.flags) or containsOrIncl(m.declaredThings, sym.id):