From 807bc1db3dea6d5c6bfdb228df6c207d65462e9a Mon Sep 17 00:00:00 2001 From: Alexandre Petit-Bianco Date: Thu, 20 Apr 2000 02:52:26 +0000 Subject: [PATCH] parse.y (yyerror): `msg' can be null, don't use it in that case. 2000-04-19 Alexandre Petit-Bianco * parse.y (yyerror): `msg' can be null, don't use it in that case. From-SVN: r33270 --- gcc/java/ChangeLog | 4 ++++ gcc/java/parse.c | 2 +- gcc/java/parse.y | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index dc1d3e051f3..8d2ba834b24 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,7 @@ +2000-04-19 Alexandre Petit-Bianco + + * parse.y (yyerror): `msg' can be null, don't use it in that case. + 2000-04-19 Tom Tromey * gjavah.c (cxx_keyword_subst): Avoid potential infinite loop. diff --git a/gcc/java/parse.c b/gcc/java/parse.c index ef9401b16fd..ac7bdac1493 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 dc418082122..d427c341aaf 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; -- 2.30.2