diff options
author | Andrew Haley <aph@redhat.com> | 2002-09-05 13:24:41 +0000 |
---|---|---|
committer | Andrew Haley <aph@redhat.com> | 2002-09-05 13:24:41 +0000 |
commit | b8f05767dac66551ade9f9f7c06883bd403240e1 (patch) | |
tree | c4640e65d1a3edd785878c258a17aaf2680193ca /gcc/java | |
parent | 9a3bcc37adb78e23fc4c68e68a8ca5c430c0fffe (diff) |
2002-08-28 Andrew Haley <aph@redhat.com>
* verify.c (verify_jvm_instructions): Allow exception handler
inside code that is being protected, but generate a warning.
* except.c (link_handler): Initialize `expanded' in new eh_range.
(binding_depth, is_class_level, current_pc): Declare extern.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@56842 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/java/except.c | 7 | ||||
-rw-r--r-- | gcc/java/verify.c | 4 |
3 files changed, 14 insertions, 4 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 8195d1f03e9..2eb6a9d2d92 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,10 @@ +2002-08-28 Andrew Haley <aph@redhat.com> + + * verify.c (verify_jvm_instructions): Allow exception handler + inside code that is being protected, but generate a warning. + * except.c (link_handler): Initialize `expanded' in new eh_range. + (binding_depth, is_class_level, current_pc): Declare extern. + 2002-09-01 Mark Wielaard <mark@klomp.org> * gcj.texi: Add chapter about system properties. diff --git a/gcc/java/except.c b/gcc/java/except.c index ef773e4a6b3..614587d3362 100644 --- a/gcc/java/except.c +++ b/gcc/java/except.c @@ -61,9 +61,9 @@ static struct eh_range *cache_next_child; struct eh_range whole_range; #if defined(DEBUG_JAVA_BINDING_LEVELS) -int binding_depth; -int is_class_level; -int current_pc; +extern int binding_depth; +extern int is_class_level; +extern int current_pc; extern void indent (); #endif @@ -172,6 +172,7 @@ link_handler (range, outer) h->handlers = build_tree_list (TREE_PURPOSE (range->handlers), TREE_VALUE (range->handlers)); h->next_sibling = NULL; + h->expanded = 0; /* Restart both from the top to avoid having to make this function smart about reentrancy. */ link_handler (h, &whole_range); diff --git a/gcc/java/verify.c b/gcc/java/verify.c index b81927e6913..c3b3b98a84d 100644 --- a/gcc/java/verify.c +++ b/gcc/java/verify.c @@ -471,7 +471,6 @@ verify_jvm_instructions (jcf, byte_ops, length) if (start_pc < 0 || start_pc >= length || end_pc < 0 || end_pc > length || start_pc >= end_pc || handler_pc < 0 || handler_pc >= length - || (handler_pc >= start_pc && handler_pc < end_pc) || ! (instruction_bits [start_pc] & BCODE_INSTRUCTION_START) || (end_pc < length && ! (instruction_bits [end_pc] & BCODE_INSTRUCTION_START)) @@ -482,6 +481,9 @@ verify_jvm_instructions (jcf, byte_ops, length) return 0; } + if (handler_pc >= start_pc && handler_pc < end_pc) + warning ("exception handler inside code that is being protected"); + add_handler (start_pc, end_pc, lookup_label (handler_pc), catch_type == 0 ? NULL_TREE |