]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* win32_threads.c (GC_push_all_stacks): Tolerate bad sp.
authorHans Boehm <Hans_Boehm@hp.com>
Sat, 29 Jun 2002 17:29:51 +0000 (17:29 +0000)
committerHans Boehm <hboehm@gcc.gnu.org>
Sat, 29 Jun 2002 17:29:51 +0000 (17:29 +0000)
From-SVN: r55103

boehm-gc/ChangeLog
boehm-gc/win32_threads.c

index 2c63a6d57c24a607d5f4c0113bad3c4a0b0c46c1..cec30a4672145e3c86ebafe5f55d434e843bf728 100644 (file)
@@ -1,3 +1,8 @@
+2002-06-28  Hans Boehm <Hans_Boehm@hp.com> 
+           Jonathan Clark 
+
+        * win32_threads.c (GC_push_all_stacks): Tolerate bad sp. 
+
 2002-05-14  Release Manager
 
        * GCC 3.1 Released.
index 38de099fa87cc677351945ec35066d9442a57e36..d5e3920cbe4cb2a0ed1e60c2e2fa8dc0066e1e95 100644 (file)
@@ -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