diff options
author | Alexandre Petit-Bianco <apbianco@cygnus.com> | 1999-12-30 22:36:25 +0000 |
---|---|---|
committer | Alexandre Petit-Bianco <apbianco@gcc.gnu.org> | 1999-12-30 14:36:25 -0800 |
commit | e920ebc9311d99636a40f1ff229ecd4167f46166 (patch) | |
tree | 9853301b4a969ce1435d6529c461d2f6510bc73a /gcc/java/expr.c | |
parent | f0353e33dc68775a0c880a86d24b7f8df95ed7c7 (diff) | |
download | gcc-e920ebc9311d99636a40f1ff229ecd4167f46166.zip gcc-e920ebc9311d99636a40f1ff229ecd4167f46166.tar.gz gcc-e920ebc9311d99636a40f1ff229ecd4167f46166.tar.bz2 |
class.c (class_depth): Return -1 if the class doesn't load properly.
1999-12-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
* class.c (class_depth): Return -1 if the class doesn't load
properly.
* expr.c (can_widen_reference_to): Check for errors during depth
computation and return 0 accordingly.
* jcf-parse.c (parse_source_file): Call java_fix_constructors to
create default constructors and add an other error check.
* parse.h (java_fix_constructors): Prototyped.
* parse.y (java_pre_expand_clinit): Likewise.
(build_super_invocation): Re-prototyped to feature one argument.
(java_check_circular_reference): Directly use `current'.
(java_fix_constructors): New function.
(java_check_regular_methods): Don't create default constructors
here, but abort if none were found.
(java_complete_expand_methods): Pre-process <clinit> calling
java_pre_expand_clinit.
(java_pre_expand_clinit): New function.
(fix_constructors): build_super_invocation invoked with the
current method declaration as an argument.
(build_super_invocation): Use the context of the processed method
decl argument instead of current_class.
* typeck.c (lookup_java_method): Take WFLs in method names into
account.
From-SVN: r31144
Diffstat (limited to 'gcc/java/expr.c')
-rw-r--r-- | gcc/java/expr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c index c7332a52..d789efb 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -386,6 +386,10 @@ can_widen_reference_to (source_type, target_type) int source_depth = class_depth (source_type); int target_depth = class_depth (target_type); + /* class_depth can return a negative depth if an error occurred */ + if (source_depth < 0 || target_depth < 0) + return 0; + if (CLASS_INTERFACE (TYPE_NAME (target_type))) { /* target_type is OK if source_type or source_type ancestors |