diff --git a/reactos/lib/3rdparty/mingw/tlssup.c b/reactos/lib/3rdparty/mingw/tlssup.c index 1c32d0d62a6..70fdc6ba224 100644 --- a/reactos/lib/3rdparty/mingw/tlssup.c +++ b/reactos/lib/3rdparty/mingw/tlssup.c @@ -99,6 +99,7 @@ BOOL WINAPI __dyn_tls_init (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved) { _PVFV *pfunc; + uintptr_t ps; #ifndef _WIN64 if (_winmajor < 4) @@ -135,8 +136,11 @@ __dyn_tls_init (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved) return TRUE; } - for (pfunc = &__xd_a + 1; pfunc != &__xd_z; ++pfunc) + ps = (uintptr_t) &__xd_a; + ps += sizeof (uintptr_t); + for ( ; ps != (uintptr_t) &__xd_z; ps += sizeof (uintptr_t)) { + pfunc = (_PVFV *) ps; if (*pfunc != NULL) (*pfunc)(); }