Commit 20fdc40c by Ben Elliston Committed by Ben Elliston

eh_alloc.cc (__cxa_free_exception): Don't refer to the emergency_buffer using…

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
parent b818de22
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> 2007-01-30 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/30571 PR libstdc++/30571
......
...@@ -143,12 +143,13 @@ __cxxabiv1::__cxa_allocate_exception(std::size_t thrown_size) throw() ...@@ -143,12 +143,13 @@ __cxxabiv1::__cxa_allocate_exception(std::size_t thrown_size) throw()
extern "C" void extern "C" void
__cxxabiv1::__cxa_free_exception(void *vptr) throw() __cxxabiv1::__cxa_free_exception(void *vptr) throw()
{ {
char *base = (char *) emergency_buffer;
char *ptr = (char *) vptr; char *ptr = (char *) vptr;
if (ptr >= &emergency_buffer[0][0] if (ptr >= base
&& ptr < &emergency_buffer[0][0] + sizeof (emergency_buffer)) && ptr < base + sizeof (emergency_buffer))
{ {
const unsigned int which 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); __gnu_cxx::__scoped_lock sentry(emergency_mutex);
emergency_used &= ~((bitmask_type)1 << which); emergency_used &= ~((bitmask_type)1 << which);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment