aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/java/ChangeLog4
-rw-r--r--gcc/java/parse.c2
-rw-r--r--gcc/java/parse.y2
3 files changed, 6 insertions, 2 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index dc1d3e0..8d2ba83 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,7 @@
+2000-04-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
+ * parse.y (yyerror): `msg' can be null, don't use it in that case.
+
2000-04-19 Tom Tromey <tromey@cygnus.com>
* gjavah.c (cxx_keyword_subst): Avoid potential infinite loop.
diff --git a/gcc/java/parse.c b/gcc/java/parse.c
index ef9401b..ac7bdac 100644
--- a/gcc/java/parse.c
+++ b/gcc/java/parse.c
@@ -5630,7 +5630,7 @@ yyerror (msg)
else
java_error_count++;
- if (elc.col == 0 && msg[1] == ';')
+ if (elc.col == 0 && msg && msg[1] == ';')
{
elc.col = ctxp->p_line->char_col-1;
elc.line = ctxp->p_line->lineno;
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index dc41808..d427c34 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -2932,7 +2932,7 @@ yyerror (msg)
else
java_error_count++;
- if (elc.col == 0 && msg[1] == ';')
+ if (elc.col == 0 && msg && msg[1] == ';')
{
elc.col = ctxp->p_line->char_col-1;
elc.line = ctxp->p_line->lineno;