From 32d7e5881bd67bbe4bb04794f8e1be5fef88cb0e Mon Sep 17 00:00:00 2001 From: Hans Boehm Date: Sat, 29 Jun 2002 17:29:51 +0000 Subject: [PATCH] * win32_threads.c (GC_push_all_stacks): Tolerate bad sp. From-SVN: r55103 --- boehm-gc/ChangeLog | 5 +++++ boehm-gc/win32_threads.c | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index 2c63a6d57c24..cec30a467214 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,8 @@ +2002-06-28 Hans Boehm + Jonathan Clark + + * win32_threads.c (GC_push_all_stacks): Tolerate bad sp. + 2002-05-14 Release Manager * GCC 3.1 Released. diff --git a/boehm-gc/win32_threads.c b/boehm-gc/win32_threads.c index 38de099fa87c..d5e3920cbe4c 100644 --- a/boehm-gc/win32_threads.c +++ b/boehm-gc/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 -- 2.47.2