aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/jcf-parse.c
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>2005-06-13 12:30:47 -0700
committerPer Bothner <bothner@gcc.gnu.org>2005-06-13 12:30:47 -0700
commit885beb81abe41d740e709e42f1d288910bfd1c73 (patch)
tree381fbfa6314b752218f977d1bb3a01148c26892e /gcc/java/jcf-parse.c
parenta1b6a5910bb7a4db753e0cbc28e4c9496e40fc13 (diff)
downloadgcc-885beb81abe41d740e709e42f1d288910bfd1c73.zip
gcc-885beb81abe41d740e709e42f1d288910bfd1c73.tar.gz
gcc-885beb81abe41d740e709e42f1d288910bfd1c73.tar.bz2
expr.c (int highest_label_pc_this_method, [...]): New globals.
* expr.c (int highest_label_pc_this_method, start_label_pc_this_method): New globals. (lookup_label): Add start_label_pc_this_method to pc for label, and update highest_label_pc_this_method. This prevents conflicts between labels from different methods. * java-tree.h: Declare new globals. * jcf-parse.c (parse_class_file): If needed bump start_label_pc_this_method and reset highest_label_pc_this_method. From-SVN: r100896
Diffstat (limited to 'gcc/java/jcf-parse.c')
-rw-r--r--gcc/java/jcf-parse.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index ccf6d34d..29c257f 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -929,6 +929,21 @@ parse_class_file (void)
give_name_to_locals (jcf);
+ /* Bump up start_label_pc_this_method so we get a unique label number
+ and reset highest_label_pc_this_method. */
+ if (highest_label_pc_this_method >= 0)
+ {
+ /* We adjust to the next multiple of 1000. This is just a frill
+ so the last 3 digits of the label number match the bytecode
+ offset, which might make debugging marginally more convenient. */
+ start_label_pc_this_method
+ = ((((start_label_pc_this_method + highest_label_pc_this_method)
+ / 1000)
+ + 1)
+ * 1000);
+ highest_label_pc_this_method = -1;
+ }
+
/* Convert bytecode to trees. */
expand_byte_code (jcf, method);