diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 2b6b12000e38..1718e5db6849 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2007-02-01 Ben Elliston + + * 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 PR libstdc++/30571 diff --git a/libstdc++-v3/libsupc++/eh_alloc.cc b/libstdc++-v3/libsupc++/eh_alloc.cc index 217a8cd80438..553c1c1e8580 100644 --- a/libstdc++-v3/libsupc++/eh_alloc.cc +++ b/libstdc++-v3/libsupc++/eh_alloc.cc @@ -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);