diff options
author | Ranjit Mathew <rmathew@hotmail.com> | 2004-06-17 13:45:23 +0000 |
---|---|---|
committer | Ranjit Mathew <rmathew@gcc.gnu.org> | 2004-06-17 13:45:23 +0000 |
commit | cfb6b4b8c3c01be5a1d43695c9d2988838f2254a (patch) | |
tree | e9e1192174fd464acc4c3c8b496859d2d296a690 /gcc/java/parse.y | |
parent | 794c3bee303760a10e5442d23cda23b6c71ed5ea (diff) | |
download | gcc-cfb6b4b8c3c01be5a1d43695c9d2988838f2254a.zip gcc-cfb6b4b8c3c01be5a1d43695c9d2988838f2254a.tar.gz gcc-cfb6b4b8c3c01be5a1d43695c9d2988838f2254a.tar.bz2 |
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
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r-- | gcc/java/parse.y | 17 |
1 files changed, 15 insertions, 2 deletions
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) { |