summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/ccgthreadvars.nim1
-rw-r--r--compiler/ccgtypes.nim1
2 files changed, 2 insertions, 0 deletions
diff --git a/compiler/ccgthreadvars.nim b/compiler/ccgthreadvars.nim
index 8bf5e573f..eba46f829 100644
--- a/compiler/ccgthreadvars.nim
+++ b/compiler/ccgthreadvars.nim
@@ -42,6 +42,7 @@ proc declareThreadVar(m: BModule, s: PSym, isExtern: bool) =
 proc generateThreadLocalStorage(m: BModule) =
   if m.g.nimtv != nil and (usesThreadVars in m.flags or sfMainModule in m.module.flags):
     for t in items(m.g.nimtvDeps): discard getTypeDesc(m, t)
+    finishTypeDescriptions(m)
     m.s[cfsSeqTypes].addf("typedef struct {$1} NimThreadVars;$n", [m.g.nimtv])
 
 proc generateThreadVarsSize(m: BModule) =
diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim
index fb205110e..f1dc85818 100644
--- a/compiler/ccgtypes.nim
+++ b/compiler/ccgtypes.nim
@@ -944,6 +944,7 @@ proc finishTypeDescriptions(m: BModule) =
     else:
       discard getTypeDescAux(m, t, check)
     inc(i)
+  m.typeStack.setLen 0
 
 template cgDeclFrmt*(s: PSym): string =
   s.constraint.strVal