Imported Upstream version 20101127 upstream/20101127
authorDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 1 Oct 2021 05:46:33 +0000 (14:46 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 1 Oct 2021 05:46:33 +0000 (14:46 +0900)
CHANGES
VERSION
output.c
package/byacc.spec
package/debian/changelog
test/calc2.tab.c
test/calc3.tab.c

diff --git a/CHANGES b/CHANGES
index 340b7fe..7cb4d53 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,11 @@
+2010-11-27  Thomas Dickey  <tom@crayon>
+
+       * package/byacc.spec, package/debian/changelog, VERSION: bump
+
+       * output.c:
+       corrected use of %parse-param value in yyerror(); it doesn't use &yylval
+       (report by Clifford Yapp)
+
 2010-11-26  Thomas Dickey  <tom@crayon>
 
        * skeleton.c: typo
diff --git a/VERSION b/VERSION
index 60c6408..65e43a6 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-20101126
+20101127
index 1d4f771..eaa2834 100644 (file)
--- a/output.c
+++ b/output.c
@@ -1,4 +1,4 @@
-/* $Id: output.c,v 1.36 2010/11/26 16:47:40 tom Exp $ */
+/* $Id: output.c,v 1.37 2010/11/27 17:28:29 tom Exp $ */
 
 #include "defs.h"
 
@@ -1299,8 +1299,16 @@ output_error_decl(void)
     putl_code("/* Parameters sent to yyerror. */\n");
     if (parse_param)
     {
+       param *p;
+
        putl_code("#define YYERROR_DECL() yyerror(YYSTYPE *v, const char *s)\n");
-       putl_code("#define YYERROR_CALL(msg) yyerror(&yylval, msg)\n");
+
+       puts_code("#define YYERROR_CALL(msg) yyerror(");
+
+       for (p = parse_param; p; p = p->next)
+           fprintf(code_file, "%s, ", p->name);
+
+       putl_code("msg)\n");
     }
     else
     {
@@ -1355,7 +1363,9 @@ output_yyerror_call(const char *msg)
     puts_code("    yyerror(");
     if (parse_param)
     {
-       puts_code("&yylval, ");
+       param *p;
+       for (p = parse_param; p; p = p->next)
+           fprintf(code_file, "%s, ", p->name);
     }
     puts_code("\"");
     puts_code(msg);
index e2c9183..3c355b5 100644 (file)
@@ -1,8 +1,8 @@
 Summary: byacc - public domain Berkeley LALR Yacc parser generator
 %define AppProgram byacc
-%define AppVersion 20101126
+%define AppVersion 20101127
 %define UseProgram yacc
-# $XTermId: byacc.spec,v 1.5 2010/11/26 09:22:40 tom Exp $
+# $XTermId: byacc.spec,v 1.6 2010/11/27 17:32:08 tom Exp $
 Name: %{AppProgram}
 Version: %{AppVersion}
 Release: 1
index 2ae7dd9..b012531 100644 (file)
@@ -1,3 +1,9 @@
+byacc (20101127) unstable; urgency=low
+
+  * corrected yyerror use of %parse-param data
+
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 27 Nov 2010 12:32:00 -0500
+
 byacc (20101126) unstable; urgency=low
 
   * additional fix to generated code to avoid symbol conflict
index 5d863a5..4cf9c03 100644 (file)
@@ -128,7 +128,7 @@ typedef int YYSTYPE;
 
 /* Parameters sent to yyerror. */
 #define YYERROR_DECL() yyerror(YYSTYPE *v, const char *s)
-#define YYERROR_CALL(msg) yyerror(&yylval, msg)
+#define YYERROR_CALL(msg) yyerror(regs, base, msg)
 
 extern int YYPARSE_DECL();
 extern int YYLEX_DECL();
@@ -473,7 +473,7 @@ yyloop:
     }
     if (yyerrflag) goto yyinrecovery;
 
-    yyerror(&yylval, "syntax error");
+    yyerror(regs, base, "syntax error");
 
     goto yyerrlab;
 
@@ -658,7 +658,7 @@ to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
     goto yyloop;
 
 yyoverflow:
-    yyerror(&yylval, "yacc stack overflow");
+    yyerror(regs, base, "yacc stack overflow");
 
 yyabort:
     yyfreestack(&yystack);
index 50b9009..1ef1908 100644 (file)
@@ -128,7 +128,7 @@ typedef int YYSTYPE;
 
 /* Parameters sent to yyerror. */
 #define YYERROR_DECL() yyerror(YYSTYPE *v, const char *s)
-#define YYERROR_CALL(msg) yyerror(&yylval, msg)
+#define YYERROR_CALL(msg) yyerror(regs, base, msg)
 
 extern int YYPARSE_DECL();
 extern int YYLEX_DECL();
@@ -473,7 +473,7 @@ yyloop:
     }
     if (yyerrflag) goto yyinrecovery;
 
-    yyerror(&yylval, "syntax error");
+    yyerror(regs, base, "syntax error");
 
     goto yyerrlab;
 
@@ -658,7 +658,7 @@ to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
     goto yyloop;
 
 yyoverflow:
-    yyerror(&yylval, "yacc stack overflow");
+    yyerror(regs, base, "yacc stack overflow");
 
 yyabort:
     yyfreestack(&yystack);