]> gcc.gnu.org Git - gcc.git/commitdiff
verify.c (verify_jvm_instructions): Allow exception handler inside code that is being...
authorAndrew Haley <aph@redhat.com>
Thu, 5 Sep 2002 13:24:41 +0000 (13:24 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Thu, 5 Sep 2002 13:24:41 +0000 (13:24 +0000)
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.

From-SVN: r56842

gcc/java/ChangeLog
gcc/java/except.c
gcc/java/verify.c

index 8195d1f03e90ba7dc019d637a7ed35cf7ca29956..2eb6a9d2d92c8f0cc2c84e8564fab24f5327f53b 100644 (file)
@@ -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.
index ef773e4a6b32456c907e8e14fafa9bc4acd81838..614587d33622f2ba7c6f04d7582cdb1896f0e33c 100644 (file)
@@ -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);
index b81927e6913fcbc024c9320d5d026733bb9e545d..c3b3b98a84d1743eb9f5b8776645830a3345601e 100644 (file)
@@ -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
This page took 0.076462 seconds and 5 git commands to generate.