summaryrefslogtreecommitdiff
path: root/boehm-gc/win32_threads.c
diff options
context:
space:
mode:
authorhboehm <hboehm@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-29 17:34:06 +0000
committerhboehm <hboehm@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-29 17:34:06 +0000
commit97b7aec8ddd15f96470e9edbb05a6a0495537ca9 (patch)
tree26f258462c9ac6e5b975c83babf86f1388f5e9ef /boehm-gc/win32_threads.c
parent67e09af27443cce9d9a7c1e4966c42f7404ba42c (diff)
downloadgcc-97b7aec8ddd15f96470e9edbb05a6a0495537ca9.tar.gz
* 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
Diffstat (limited to 'boehm-gc/win32_threads.c')
-rw-r--r--boehm-gc/win32_threads.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/boehm-gc/win32_threads.c b/boehm-gc/win32_threads.c
index 38de099fa87..d5e3920cbe4 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