aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/parse.y
diff options
context:
space:
mode:
authorAndrew Haley <aph@cygnus.com>1999-05-11 12:09:13 +0000
committerAndrew Haley <aph@gcc.gnu.org>1999-05-11 12:09:13 +0000
commit138657ecb0d28fa0c8df47db35f156ea4aa3b590 (patch)
tree98e4984a170319b0749e4b4b7ab541d5bbd4a955 /gcc/java/parse.y
parent6a09296d7aa232eafa5ba864338138ea917a0093 (diff)
downloadgcc-138657ecb0d28fa0c8df47db35f156ea4aa3b590.zip
gcc-138657ecb0d28fa0c8df47db35f156ea4aa3b590.tar.gz
gcc-138657ecb0d28fa0c8df47db35f156ea4aa3b590.tar.bz2
parse.y (source_end_java_method): If the current method contains any exception handlers...
1999-05-11 Andrew Haley <aph@cygnus.com> * parse.y (source_end_java_method): If the current method contains any exception handlers, force asynchronous_exceptions: this is necessary because signal handlers in libjava may throw exceptions. * decl.c (end_java_method): Ditto. From-SVN: r26884
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r--gcc/java/parse.y10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 82598de..ac1876c 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -62,6 +62,7 @@ definitions and other extensions. */
#include "convert.h"
#include "buffer.h"
#include "xref.h"
+#include "except.h"
#ifndef DIR_SEPARATOR
#define DIR_SEPARATOR '/'
@@ -5516,6 +5517,7 @@ static void
source_end_java_method ()
{
tree fndecl = current_function_decl;
+ int flag_asynchronous_exceptions = asynchronous_exceptions;
java_parser_context_save_global ();
lineno = ctxp->last_ccb_indent1;
@@ -5548,6 +5550,13 @@ source_end_java_method ()
emit_handlers ();
expand_function_end (input_filename, lineno, 0);
+ /* FIXME: If the current method contains any exception handlers,
+ force asynchronous_exceptions: this is necessary because signal
+ handlers in libjava may throw exceptions. This is far from being
+ a perfect solution, but it's better than doing nothing at all.*/
+ if (catch_clauses)
+ asynchronous_exceptions = 1;
+
/* Run the optimizers and output assembler code for this function. */
rest_of_compilation (fndecl);
}
@@ -5555,6 +5564,7 @@ source_end_java_method ()
current_function_decl = NULL_TREE;
/* permanent_allocation (1); */
java_parser_context_restore_global ();
+ asynchronous_exceptions = flag_asynchronous_exceptions;
}
/* Record EXPR in the current function block. Complements compound