mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-12 13:53:03 +00:00
portability: fix pointer arithmetic to conform to C standard.
Reported by Tys Lefering at <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>. This fix is already implemented in glr.c and does not apply to lalr1.java. * data/lalr1.cc (yy::parser::parse): Increase size of yyerror_range and adjust subscripting so you don't have to subtract one from the beginning of the array. * data/yacc.c (b4_declare_parser_state_variables, yyparse, yypush_parse): Likewise.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* A Bison parser, made by GNU Bison 2.4.1.61-f1ce. */
|
||||
/* A Bison parser, made by GNU Bison 2.4.2.5-1849. */
|
||||
|
||||
/* Skeleton implementation for Bison's Yacc-like parsers in C
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
#define YYBISON 1
|
||||
|
||||
/* Bison version. */
|
||||
#define YYBISON_VERSION "2.4.1.61-f1ce"
|
||||
#define YYBISON_VERSION "2.4.2.5-1849"
|
||||
|
||||
/* Skeleton name. */
|
||||
#define YYSKELETON_NAME "yacc.c"
|
||||
@@ -1640,7 +1640,7 @@ YYLTYPE yylloc;
|
||||
YYLTYPE *yylsp;
|
||||
|
||||
/* The locations where the error started and ended. */
|
||||
YYLTYPE yyerror_range[2];
|
||||
YYLTYPE yyerror_range[3];
|
||||
|
||||
YYSIZE_T yystacksize;
|
||||
|
||||
@@ -2703,7 +2703,7 @@ yyerrlab:
|
||||
#endif
|
||||
}
|
||||
|
||||
yyerror_range[0] = yylloc;
|
||||
yyerror_range[1] = yylloc;
|
||||
|
||||
if (yyerrstatus == 3)
|
||||
{
|
||||
@@ -2740,7 +2740,7 @@ yyerrorlab:
|
||||
if (/*CONSTCOND*/ 0)
|
||||
goto yyerrorlab;
|
||||
|
||||
yyerror_range[0] = yylsp[1-yylen];
|
||||
yyerror_range[1] = yylsp[1-yylen];
|
||||
/* Do not reclaim the symbols of the rule which action triggered
|
||||
this YYERROR. */
|
||||
YYPOPSTACK (yylen);
|
||||
@@ -2774,7 +2774,7 @@ yyerrlab1:
|
||||
if (yyssp == yyss)
|
||||
YYABORT;
|
||||
|
||||
yyerror_range[0] = *yylsp;
|
||||
yyerror_range[1] = *yylsp;
|
||||
yydestruct ("Error: popping",
|
||||
yystos[yystate], yyvsp, yylsp);
|
||||
YYPOPSTACK (1);
|
||||
@@ -2784,10 +2784,10 @@ yyerrlab1:
|
||||
|
||||
*++yyvsp = yylval;
|
||||
|
||||
yyerror_range[1] = yylloc;
|
||||
yyerror_range[2] = yylloc;
|
||||
/* Using YYLLOC is tempting, but would change the location of
|
||||
the lookahead. YYLOC is available though. */
|
||||
YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
|
||||
YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
|
||||
*++yylsp = yyloc;
|
||||
|
||||
/* Shift the error token. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* A Bison parser, made by GNU Bison 2.4.1.61-f1ce. */
|
||||
/* A Bison parser, made by GNU Bison 2.4.2.5-1849. */
|
||||
|
||||
/* Skeleton interface for Bison's Yacc-like parsers in C
|
||||
|
||||
|
||||
Reference in New Issue
Block a user