summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>2000-03-22 22:48:04 +0000
committerapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>2000-03-22 22:48:04 +0000
commit45e08618f6f826d14150a11d4bc72ea11db0cb9a (patch)
tree7ff9d69ae677363a7ddaa8ec0ed1b04d4fdbdd72 /gcc
parent5e4674d9c6742e5462c5ca9ec623b8775d6cab1c (diff)
downloadgcc-45e08618f6f826d14150a11d4bc72ea11db0cb9a.tar.gz
Mon Mar 20 08:58:51 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
* jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR: properly initialize `finished_label.' Don't emit gotos for empty try statements. (Minor fix: http://gcc.gnu.org/ml/gcc-patches/2000-03/msg00762.html) git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32690 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/java/ChangeLog6
-rw-r--r--gcc/java/jcf-write.c7
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index f96e28713f2..6a2a09b22c0 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,9 @@
+Mon Mar 20 08:58:51 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
+ * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
+ properly initialize `finished_label.' Don't emit gotos for empty
+ try statements.
+
2000-03-19 Martin v. Löwis <loewis@informatik.hu-berlin.de>
* except.c (emit_handlers): Clear catch_clauses_last.
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index 4eccf254c57..0b510a0aa23 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -2317,8 +2317,9 @@ generate_bytecode_insns (exp, target, state)
tree finally = TREE_OPERAND (exp, 1);
tree return_link, exception_decl;
- finished_label = finally_label = start_label = NULL;
+ finally_label = start_label = NULL;
return_link = exception_decl = NULL_TREE;
+ finished_label = gen_jcf_label (state);
/* If the finally clause happens to be empty, set a flag so we
remember to just skip it. */
@@ -2333,7 +2334,6 @@ generate_bytecode_insns (exp, target, state)
exception_type = build_pointer_type (throwable_type_node);
exception_decl = build_decl (VAR_DECL, NULL_TREE, exception_type);
- finished_label = gen_jcf_label (state);
finally_label = gen_jcf_label (state);
start_label = get_jcf_label_here (state);
finally_label->pc = PENDING_CLEANUP_PC;
@@ -2352,7 +2352,8 @@ generate_bytecode_insns (exp, target, state)
emit_jsr (finally_label, state);
}
- if (CAN_COMPLETE_NORMALLY (try_block))
+ if (CAN_COMPLETE_NORMALLY (try_block)
+ && BLOCK_EXPR_BODY (try_block) != empty_stmt_node)
emit_goto (finished_label, state);
/* Handle exceptions. */