Skip to content

Commit 0ae3103

Browse files
committed
fix debug assertion for windows TLS
1 parent 72f05e2 commit 0ae3103

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/prim/windows/prim.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -644,12 +644,12 @@ static void mi_win_tls_init(DWORD reason) {
644644
#endif
645645
if (reason==DLL_PROCESS_ATTACH || reason==DLL_THREAD_ATTACH) {
646646
if (mi_prim_get_default_heap() == NULL) {
647-
_mi_heap_set_default_direct((mi_heap_t*)&_mi_heap_empty);
647+
_mi_heap_set_default_direct((mi_heap_t*)&_mi_heap_empty);
648+
#if MI_DEBUG && MI_WIN_USE_FIXED_TLS==1
649+
void* const p = TlsGetValue((DWORD)(_mi_win_tls_offset / sizeof(void*)));
650+
mi_assert_internal(p == (void*)&_mi_heap_empty);
651+
#endif
648652
}
649-
#if MI_DEBUG && MI_WIN_USE_FIXED_TLS==1
650-
void* const p = TlsGetValue((DWORD)(_mi_win_tls_offset / sizeof(void*)));
651-
mi_assert_internal(p == (void*)&_mi_heap_empty);
652-
#endif
653653
}
654654
#else
655655
MI_UNUSED(reason);

0 commit comments

Comments
 (0)