Skip to content

Commit c7b03c4

Browse files
committed
TSD: correct FlsAlloc check
FlsAlloc returns FLS_OUT_OF_INDEXES in an error scenario, everything else is a valid result. Correct the assertion.
1 parent 7fb3400 commit c7b03c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/shims/tsd.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ DISPATCH_TSD_INLINE
112112
static inline void
113113
_dispatch_thread_key_create(DWORD *k, void (DISPATCH_TSD_DTOR_CC *d)(void *))
114114
{
115-
dispatch_assert_zero((*k = FlsAlloc(d)));
115+
*k = FlsAlloc(d);
116+
dispatch_assert(*k != FLS_OUT_OF_INDEXES);
116117
}
117118

118119
extern DWORD __dispatch_tsd_key;

0 commit comments

Comments
 (0)