From 21b5c3a4ec7a4fed16ffa2308d8715e99e6050ef Mon Sep 17 00:00:00 2001 From: Dmitry Gorbachev Date: Tue, 26 Jul 2011 01:16:32 +0000 Subject: [PATCH] [MINGW-W64] Reduce differences with upstream. Fixes crash if ReactOS is compiled with GCC 4.6. svn path=/trunk/; revision=52886 --- reactos/lib/3rdparty/mingw/tlssup.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)(); }