summary refs log tree commit diff stats
path: root/lib/system
diff options
context:
space:
mode:
Diffstat (limited to 'lib/system')
-rwxr-xr-xlib/system/excpt.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim
index 9bdc69569..e2d3bea08 100755
--- a/lib/system/excpt.nim
+++ b/lib/system/excpt.nim
@@ -106,9 +106,10 @@ when hasThreadSupport:
     PGlobals = ptr TGlobals
 
   var globalsSlot = ThreadVarAlloc()
-  proc CreateThreadLocalStorage*() {.inl.} =
+  proc CreateThreadLocalStorage*(): pointer {.inl.} =
     isMultiThreaded = true
-    ThreadVarSetValue(globalsSlot, alloc0(sizeof(TGlobals)))
+    result = alloc0(sizeof(TGlobals))
+    ThreadVarSetValue(globalsSlot, result)
     
   proc GetGlobals(): PGlobals {.compilerRtl, inl.} =
     result = cast[PGlobals](ThreadVarGetValue(globalsSlot))