This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PR 4351, sjlj exception handling, HP-UX


Hi,

This is a patch against mainline for PR 4351, which occurs
on HP-UX.  The testcase for this patch
is attached to PR 4351:

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4351&database=gcc


The following patch and explanation was provided by
Jessica Han <jessica@cup.hp.com>:

"The problem only shows up in sjlj exception handling, where most platforms are
using call frame exception handling. I'm positive that the same testcase
also fails on other platforms which are also using sjlj exception handling.
The best description I can get is:
in sjlj_emit_dispatch_table() when it is trying to access
cfun->eh->region_array[0], which should always be a NULL pointer. The
function being compiled " void
PortableServer::POA::AdapterAlreadyExists::_raise() {throw  *this;} "  has
only one exception handling region, and it is marked as
 "ERT_MUST_NOT_THROW".  It doesn't have any directly reachable region, thus
cfun->eh->region_array[0] is used for dereference, and caused the core dump.


2001-12-06  Craig Rodrigues  <rodrigc@gcc.gnu.org>
            Jessica Han <jessica@cup.hp.com>

	PR c++/4351 
        * except.c (sjlj_emit_dispatch_table): Fix for functions which
	do not have any directly reachable region.

diff -c except.c except.c.new
*** except.c    Wed Nov 14 15:17:55 2001
--- except.c.new        Wed Dec  5 14:12:13 2001
***************
*** 2270,2277 ****
    seq = get_insns ();
    end_sequence ();

!   emit_insns_before (seq, (cfun->eh->region_array[first_reachable]
                           ->post_landing_pad));
  }

  static void
--- 2270,2280 ----
    seq = get_insns ();
    end_sequence ();

!   if (first_reachable)
!     emit_insns_before (seq, (cfun->eh->region_array[first_reachable]
                           ->post_landing_pad));
+   else
+     emit_insns(seq);
  }

  static void

-- 
Craig Rodrigues        
http://www.gis.net/~craigr    
rodrigc@mediaone.net          


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]