+2001-04-11 Ulrich Drepper <drepper@redhat.com>
+
+ * cancel.c (_pthread_cleanup_push): Catch invalid __prev buffer
+ and remove it.
+ (_pthread_cleanup_push_defer): Likewise.
+
+ * tst-cancel.c (main): Fix loop printing cleanup output.
+
2001-04-10 kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/sh/pspinlock.c (__pthread_spin_lock): Fix a reverse
buffer->__routine = routine;
buffer->__arg = arg;
buffer->__prev = THREAD_GETMEM(self, p_cleanup);
+ if (buffer->__prev != NULL)
+ {
+#if _STACK_GROWS_DOWN
+ if ((char *) buffer >= (char *) buffer->__prev)
+ buffer->__prev = NULL;
+#elif _STACK_GROWS_UP
+ if ((char *) buffer <= (char *) buffer->__prev)
+ buffer->__prev = NULL;
+#else
+# error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
+#endif
+ }
THREAD_SETMEM(self, p_cleanup, buffer);
}
buffer->__arg = arg;
buffer->__canceltype = THREAD_GETMEM(self, p_canceltype);
buffer->__prev = THREAD_GETMEM(self, p_cleanup);
+ if (buffer->__prev != NULL)
+ {
+#if _STACK_GROWS_DOWN
+ if ((char *) buffer >= (char *) buffer->__prev)
+ buffer->__prev = NULL;
+#elif _STACK_GROWS_UP
+ if ((char *) buffer <= (char *) buffer->__prev)
+ buffer->__prev = NULL;
+#endif
+ }
THREAD_SETMEM(self, p_canceltype, PTHREAD_CANCEL_DEFERRED);
THREAD_SETMEM(self, p_cleanup, buffer);
}
#elif _STACK_GROWS_UP
if ((char *) c >= currentframe)
break;
-#else
-# error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
#endif
c->__routine(c->__arg);
}