From cfb6b4b8c3c01be5a1d43695c9d2988838f2254a Mon Sep 17 00:00:00 2001 From: Ranjit Mathew Date: Thu, 17 Jun 2004 13:45:23 +0000 Subject: re PR java/13948 (GCJ segmentation fault while compiling GL4Java .class files) Fixes PR java/13948 * parse.y (java_layout_seen_class_methods): Ensure class is loaded before trying to lay out its methods. * jcf-parse.c (read_class): Track parsed files using canonical paths obtained via lrealpath from libiberty. (java_parse_file): Likewise. (parse_source_file_1): Rename formal parameter to reflect its modified purpose. Minor formatting fix. From-SVN: r83292 --- gcc/java/parse.y | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'gcc/java/parse.y') diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 65bd091..dd52a39 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -7574,7 +7574,10 @@ add_stmt_to_block (tree b, tree type, tree stmt) return c; } -void java_layout_seen_class_methods (void) +/* Lays out the methods for the classes seen so far. */ + +void +java_layout_seen_class_methods (void) { tree previous_list = all_class_list; tree end = NULL_TREE; @@ -7584,7 +7587,17 @@ void java_layout_seen_class_methods (void) { for (current = previous_list; current != end; current = TREE_CHAIN (current)) - layout_class_methods (TREE_TYPE (TREE_VALUE (current))); + { + tree cls = TREE_TYPE (TREE_VALUE (current)); + + if (! CLASS_LOADED_P (cls)) + load_class (cls, 0); + + layout_class_methods (cls); + } + + /* Note that new classes might have been added while laying out + methods, changing the value of all_class_list. */ if (previous_list != all_class_list) { -- cgit v1.1