diff options
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 65bd09186ee..dd52a39359d 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) { |

