* thread.cc (verifyable_object_isvalid): Check for NULL specifically.

This commit is contained in:
Christopher Faylor 2006-05-27 19:00:36 +00:00
parent 939f16acf2
commit 17fed6fefc
2 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,7 @@
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

View File

@ -116,12 +116,14 @@ static inline verifyable_object_state
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))