aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2004-09-24 15:44:35 +0000
committerTom Tromey <tromey@gcc.gnu.org>2004-09-24 15:44:35 +0000
commit8d481c2e58c9b25818f95269073aca647fb1c847 (patch)
tree159b1686a0eac6a490776957489d4841f8f1654d
parent013303df1bb8bd4dc0637b509ad1d0e0d58b9165 (diff)
downloadgcc-8d481c2e58c9b25818f95269073aca647fb1c847.zip
gcc-8d481c2e58c9b25818f95269073aca647fb1c847.tar.gz
gcc-8d481c2e58c9b25818f95269073aca647fb1c847.tar.bz2
re PR java/15656 (ICE segfault in lex.c)
PR java/15656: * parse.y (class_instance_creation_expression): Set `$$' to NULL in error parts of rule. (unary_expression): Don't call error_if_numeric_overflow when $1 is NULL. From-SVN: r88048
-rw-r--r--gcc/java/ChangeLog8
-rw-r--r--gcc/java/parse.y20
2 files changed, 21 insertions, 7 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index f66e444..7e7e7eb 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,5 +1,13 @@
2004-09-24 Tom Tromey <tromey@redhat.com>
+ PR java/15656:
+ * parse.y (class_instance_creation_expression): Set `$$' to NULL
+ in error parts of rule.
+ (unary_expression): Don't call error_if_numeric_overflow when $1
+ is NULL.
+
+2004-09-24 Tom Tromey <tromey@redhat.com>
+
PR java/16789:
* parse.y (resolve_qualified_expression_name): Set
CAN_COMPLETE_NORMALLY on first call when chaining static calls.
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 2287d90..0a72599 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -2016,17 +2016,22 @@ class_instance_creation_expression:
}
| something_dot_new identifier OP_TK argument_list CP_TK class_body
| NEW_TK error SC_TK
- {yyerror ("'(' expected"); DRECOVER(new_1);}
+ {$$ = NULL_TREE; yyerror ("'(' expected"); DRECOVER(new_1);}
| NEW_TK class_type error
- {yyerror ("'(' expected"); RECOVER;}
+ {$$ = NULL_TREE; yyerror ("'(' expected"); RECOVER;}
| NEW_TK class_type OP_TK error
- {yyerror ("')' or term expected"); RECOVER;}
+ {$$ = NULL_TREE; yyerror ("')' or term expected"); RECOVER;}
| NEW_TK class_type OP_TK argument_list error
- {yyerror ("')' expected"); RECOVER;}
+ {$$ = NULL_TREE; yyerror ("')' expected"); RECOVER;}
| something_dot_new error
- {YYERROR_NOW; yyerror ("Identifier expected"); RECOVER;}
+ {
+ $$ = NULL_TREE;
+ YYERROR_NOW;
+ yyerror ("Identifier expected");
+ RECOVER;
+ }
| something_dot_new identifier error
- {yyerror ("'(' expected"); RECOVER;}
+ {$$ = NULL_TREE; yyerror ("'(' expected"); RECOVER;}
;
/* Created after JDK1.1 rules originally added to
@@ -2343,7 +2348,8 @@ trap_overflow_corner_case:
unary_expression:
trap_overflow_corner_case
{
- error_if_numeric_overflow ($1);
+ if ($1)
+ error_if_numeric_overflow ($1);
$$ = $1;
}
| MINUS_TK trap_overflow_corner_case