summaryrefslogtreecommitdiff
path: root/gcc/java/except.c
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-29 00:42:54 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-29 00:42:54 +0000
commitd179df437926af00080bf7fd37acb91a3691c75f (patch)
tree4f95fed9108777c9014fb71f501071ba622709fd /gcc/java/except.c
parent9ee9948bb0cc7ecf305f2304a70324a73f679832 (diff)
downloadgcc-d179df437926af00080bf7fd37acb91a3691c75f.tar.gz
* except.c (expand_end_java_handler): If the handler type is NULL,
use java.lang.Throwable. Fixes PR java/5986. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51539 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/except.c')
-rw-r--r--gcc/java/except.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/java/except.c b/gcc/java/except.c
index 184f7e5a88b..5b315185807 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 ();
}