eh_alloc.cc (__cxa_free_exception): Don't refer to the emergency_buffer using &array[0][0]' notation, use array'.

* libsupc++/eh_alloc.cc (__cxa_free_exception): Don't refer to the
	emergency_buffer using `&array[0][0]' notation, use `array'.

From-SVN: r121456
This commit is contained in:
Ben Elliston 2007-02-01 04:04:34 +00:00 committed by Ben Elliston
parent b818de221c
commit 20fdc40c5a
2 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2007-02-01 Ben Elliston <bje@au.ibm.com>
* libsupc++/eh_alloc.cc (__cxa_free_exception): Don't refer to the
emergency_buffer using `&array[0][0]' notation, use `array'.
2007-01-30 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/30571

View File

@ -143,12 +143,13 @@ __cxxabiv1::__cxa_allocate_exception(std::size_t thrown_size) throw()
extern "C" void
__cxxabiv1::__cxa_free_exception(void *vptr) throw()
{
char *base = (char *) emergency_buffer;
char *ptr = (char *) vptr;
if (ptr >= &emergency_buffer[0][0]
&& ptr < &emergency_buffer[0][0] + sizeof (emergency_buffer))
if (ptr >= base
&& ptr < base + sizeof (emergency_buffer))
{
const unsigned int which
= (unsigned)(ptr - &emergency_buffer[0][0]) / EMERGENCY_OBJ_SIZE;
= (unsigned) (ptr - base) / EMERGENCY_OBJ_SIZE;
__gnu_cxx::__scoped_lock sentry(emergency_mutex);
emergency_used &= ~((bitmask_type)1 << which);