Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2006-05-27 23:00:36 +0400
committerChristopher Faylor <me@cgf.cx>2006-05-27 23:00:36 +0400
commit17fed6fefc2754998285a30898a4828293e83099 (patch)
tree9abe5ccd7d94511942dd57421b26fe6cee15a8f9
parent939f16acf2176d67dbab8712e1c15f03ff10a9af (diff)
* thread.cc (verifyable_object_isvalid): Check for NULL specifically.
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/thread.cc10
2 files changed, 10 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 784f58e10..c2c32cb51 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,9 @@
2006-05-27 Christopher Faylor <cgf@timesys.com>
+ * thread.cc (verifyable_object_isvalid): Check for NULL specifically.
+
+2006-05-27 Christopher Faylor <cgf@timesys.com>
+
* dll_init.cc (dll_dllcrt0): Call _my_tls.init_exception_handler if
we've finished initializing (Thanks to Gary Zablackis for noticing this
problem). Just use cygwin_finished_initializing rather than defining a
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc
index ad9061952..08eb10dd2 100644
--- a/winsup/cygwin/thread.cc
+++ b/winsup/cygwin/thread.cc
@@ -113,15 +113,17 @@ __cygwin_lock_unlock (_LOCK_T *lock)
}
static inline verifyable_object_state
-verifyable_object_isvalid (void const * objectptr, long magic, void *static_ptr1,
+verifyable_object_isvalid (void const *objectptr, long magic, void *static_ptr1,
void *static_ptr2, void *static_ptr3)
{
- verifyable_object **object = (verifyable_object **) objectptr;
-
myfault efault;
- if (efault.faulted ())
+ /* Check for NULL pointer specifically since it is a cheap test and avoids the
+ overhead of setting up the fault handler. */
+ if (!objectptr || efault.faulted ())
return INVALID_OBJECT;
+ verifyable_object **object = (verifyable_object **) objectptr;
+
if ((static_ptr1 && *object == static_ptr1) ||
(static_ptr2 && *object == static_ptr2) ||
(static_ptr3 && *object == static_ptr3))