From: hboehm Date: Sat, 29 Jun 2002 17:34:06 +0000 (+0000) Subject: * win32_threads.c (GC_push_all_stacks): Tolerate bad sp. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b24e0f6027fcfc4200b87830d9ac10ddb6c764b;p=gc * win32_threads.c (GC_push_all_stacks): Tolerate bad sp. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55104 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/ChangeLog b/ChangeLog index 2c8ab1a7..dc365819 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-06-28 Hans Boehm + Jonathan Clark + + * win32_threads.c (GC_push_all_stacks): Tolerate bad sp. + 2002-06-09 H.J. Lu (hjl@gnu.org) * include/private/gc_locks.h (GC_test_and_set): Support diff --git a/win32_threads.c b/win32_threads.c index 38de099f..d5e3920c 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -144,8 +144,15 @@ void GC_push_all_stacks() GC_push_one ((word) thread_table[i].context.Edx); GC_push_one ((word) thread_table[i].context.Ecx); GC_push_one ((word) thread_table[i].context.Eax); - GC_push_all_stack((char *) thread_table[i].context.Esp, - thread_table[i].stack); + if (thread_table[i].context.Esp >= (DWORD)thread_table[i].stack + || thread_table[i].context.Esp < (DWORD)bottom) { + WARN("Thread stack pointer 0x%lx out of range, pushing everything", + thread_table[i].context.Esp); + GC_push_all_stack((char *) bottom, thread_table[i].stack); + } else { + GC_push_all_stack((char *) thread_table[i].context.Esp, + thread_table[i].stack); + } # else # ifdef ARM32 if (thread_table[i].context.Sp >= (DWORD)thread_table[i].stack