aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authorAlexandre Petit-Bianco <apbianco@cygnus.com>2000-03-08 01:37:39 +0000
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>2000-03-07 17:37:39 -0800
commitcd7c5840050a985008c4ecc37236dde3c9dc6d28 (patch)
treeccc9a4f22abf465f91f3c7e8568dbaa14d5372dd /gcc/java
parent6632dcdd410754a2c25a117cae5fab151b94c6b4 (diff)
downloadgcc-cd7c5840050a985008c4ecc37236dde3c9dc6d28.zip
gcc-cd7c5840050a985008c4ecc37236dde3c9dc6d28.tar.gz
gcc-cd7c5840050a985008c4ecc37236dde3c9dc6d28.tar.bz2
re GNATS gcj/102 (crashes when compiling try block from java source)
2000-03-07 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (qualify_ambiguous_name): Properly handle expressions using `null'. (This fixes the Java PR #102: http://sourceware.cygnus.com/ml/java-prs/1999-q4/msg00152.html) From-SVN: r32397
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/parse.c12
-rw-r--r--gcc/java/parse.y12
3 files changed, 21 insertions, 8 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 205e847..034faed 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,5 +1,10 @@
2000-03-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
+ * parse.y (qualify_ambiguous_name): Properly handle expressions
+ using `null'.
+
+2000-03-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
* parse.y (check_final_assignment): Extended to process
COMPOUND_EXPR.
(patch_assignment): Have check_final_assignment called only once.
diff --git a/gcc/java/parse.c b/gcc/java/parse.c
index 59a1b5a..0434edf 100644
--- a/gcc/java/parse.c
+++ b/gcc/java/parse.c
@@ -10632,6 +10632,9 @@ qualify_ambiguous_name (id)
&& TREE_CODE (TREE_TYPE (qual_wfl)) == EXPR_WITH_FILE_LOCATION)
name = EXPR_WFL_NODE (TREE_TYPE (qual_wfl));
+ else if (code == INTEGER_CST)
+ name = qual_wfl;
+
else if ((code == ARRAY_REF || code == CALL_EXPR || code == MODIFY_EXPR) &&
TREE_CODE (TREE_OPERAND (qual_wfl, 0)) == EXPR_WITH_FILE_LOCATION)
name = EXPR_WFL_NODE (TREE_OPERAND (qual_wfl, 0));
@@ -10686,8 +10689,9 @@ qualify_ambiguous_name (id)
declaration or parameter declaration, then it is an expression
name. We don't carry this test out if we're in the context of the
use of SUPER or THIS */
- if (!this_found && !super_found &&
- TREE_CODE (name) != STRING_CST && (decl = IDENTIFIER_LOCAL_VALUE (name)))
+ if (!this_found && !super_found
+ && TREE_CODE (name) != STRING_CST && TREE_CODE (name) != INTEGER_CST
+ && (decl = IDENTIFIER_LOCAL_VALUE (name)))
{
RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1;
QUAL_RESOLUTION (qual) = decl;
@@ -10713,8 +10717,8 @@ qualify_ambiguous_name (id)
- NAME is declared by exactly on type-import-on-demand declaration
of the compilation unit containing NAME.
- NAME is actually a STRING_CST. */
- else if (TREE_CODE (name) == STRING_CST ||
- (decl = resolve_and_layout (name, NULL_TREE)))
+ else if (TREE_CODE (name) == STRING_CST || TREE_CODE (name) == INTEGER_CST
+ || (decl = resolve_and_layout (name, NULL_TREE)))
{
RESOLVE_TYPE_NAME_P (qual_wfl) = 1;
QUAL_RESOLUTION (qual) = decl;
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 1d8d68b9..682cf78 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -7942,6 +7942,9 @@ qualify_ambiguous_name (id)
&& TREE_CODE (TREE_TYPE (qual_wfl)) == EXPR_WITH_FILE_LOCATION)
name = EXPR_WFL_NODE (TREE_TYPE (qual_wfl));
+ else if (code == INTEGER_CST)
+ name = qual_wfl;
+
else if ((code == ARRAY_REF || code == CALL_EXPR || code == MODIFY_EXPR) &&
TREE_CODE (TREE_OPERAND (qual_wfl, 0)) == EXPR_WITH_FILE_LOCATION)
name = EXPR_WFL_NODE (TREE_OPERAND (qual_wfl, 0));
@@ -7996,8 +7999,9 @@ qualify_ambiguous_name (id)
declaration or parameter declaration, then it is an expression
name. We don't carry this test out if we're in the context of the
use of SUPER or THIS */
- if (!this_found && !super_found &&
- TREE_CODE (name) != STRING_CST && (decl = IDENTIFIER_LOCAL_VALUE (name)))
+ if (!this_found && !super_found
+ && TREE_CODE (name) != STRING_CST && TREE_CODE (name) != INTEGER_CST
+ && (decl = IDENTIFIER_LOCAL_VALUE (name)))
{
RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1;
QUAL_RESOLUTION (qual) = decl;
@@ -8023,8 +8027,8 @@ qualify_ambiguous_name (id)
- NAME is declared by exactly on type-import-on-demand declaration
of the compilation unit containing NAME.
- NAME is actually a STRING_CST. */
- else if (TREE_CODE (name) == STRING_CST ||
- (decl = resolve_and_layout (name, NULL_TREE)))
+ else if (TREE_CODE (name) == STRING_CST || TREE_CODE (name) == INTEGER_CST
+ || (decl = resolve_and_layout (name, NULL_TREE)))
{
RESOLVE_TYPE_NAME_P (qual_wfl) = 1;
QUAL_RESOLUTION (qual) = decl;