From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20170 invoked by alias); 27 Mar 2002 23:06:04 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 20128 invoked by uid 71); 27 Mar 2002 23:06:02 -0000 Date: Wed, 27 Mar 2002 15:06:00 -0000 Message-ID: <20020327230602.20125.qmail@sources.redhat.com> To: tromey@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Tom Tromey Subject: Re: java/5986: SIGSEGV in __gcj_personality_v0 Reply-To: Tom Tromey X-SW-Source: 2002-03/txt/msg01053.txt.bz2 List-Id: The following reply was made to PR java/5986; it has been noted by GNATS. From: Tom Tromey To: Jeff Sturm Cc: gcc-gnats@gcc.gnu.org, Alexandre Petit-Bianco Subject: Re: java/5986: SIGSEGV in __gcj_personality_v0 Date: 27 Mar 2002 16:39:29 -0700 Jeff> Try this one. This patch fixes the problem for me. I think the comment explains what is going on; if you think of a way to improve it let me know. I've only tested this minimally. Could you try it on your code? Alex, as always, I desire your input. Tom Index: ChangeLog from Tom Tromey * except.c (expand_end_java_handler): If the handler type is NULL, use java.lang.Throwable. Fixes PR java/5986. Index: except.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/java/except.c,v retrieving revision 1.26 diff -u -r1.26 except.c --- except.c 2001/03/28 11:01:47 1.26 +++ except.c 2002/03/27 23:03:07 @@ -1,5 +1,5 @@ /* Handle exceptions for GNU compiler for the Java(TM) language. - Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU CC. @@ -372,7 +372,17 @@ expand_start_all_catch (); for ( ; handler != NULL_TREE; handler = TREE_CHAIN (handler)) { - expand_start_catch (TREE_PURPOSE (handler)); + /* For bytecode we treat exceptions a little unusually. A + `finally' clause looks like an ordinary exception handler for + Throwable. The reason for this is that the bytecode has + already expanded the finally logic, and we would have to do + extra (and difficult) work to get this to look like a + gcc-style finally clause. */ + tree type = TREE_PURPOSE (handler); + if (type == NULL) + type = throwable_type_node; + + expand_start_catch (type); expand_goto (TREE_VALUE (handler)); expand_end_catch (); }