diff options
author | Tom Tromey <tromey@redhat.com> | 2002-03-29 00:42:54 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2002-03-29 00:42:54 +0000 |
commit | 073681c570583e3a10b8ba5fd7aca8b1eef22d66 (patch) | |
tree | 4f95fed9108777c9014fb71f501071ba622709fd | |
parent | c75e51ed689ecbb88390f2a2da496492efee7f41 (diff) | |
download | gcc-073681c570583e3a10b8ba5fd7aca8b1eef22d66.zip gcc-073681c570583e3a10b8ba5fd7aca8b1eef22d66.tar.gz gcc-073681c570583e3a10b8ba5fd7aca8b1eef22d66.tar.bz2 |
re PR java/5986 (SIGSEGV in __gcj_personality_v0)
* except.c (expand_end_java_handler): If the handler type is NULL,
use java.lang.Throwable. Fixes PR java/5986.
From-SVN: r51539
-rw-r--r-- | gcc/java/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/java/except.c | 14 |
2 files changed, 17 insertions, 2 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index c1206c4..21be206 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2002-03-28 Tom Tromey <tromey@redhat.com> + + * except.c (expand_end_java_handler): If the handler type is NULL, + use java.lang.Throwable. Fixes PR java/5986. + 2002-03-28 Alexandre Petit-Bianco <apbianco@redhat.com> Fix for PR java/4715: diff --git a/gcc/java/except.c b/gcc/java/except.c index 184f7e5..5b31518 100644 --- a/gcc/java/except.c +++ b/gcc/java/except.c @@ -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_end_java_handler (range) 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 (); } |