bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/4] yacc.c: avoid negations


From: Akim Demaille
Subject: [PATCH 1/4] yacc.c: avoid negations
Date: Sat, 4 Jan 2020 11:07:37 +0100

* data/skeletons/yacc.c (yyerrlab): here.
---
 data/skeletons/yacc.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/data/skeletons/yacc.c b/data/skeletons/yacc.c
index 1f16a733..242cca4a 100644
--- a/data/skeletons/yacc.c
+++ b/data/skeletons/yacc.c
@@ -1769,16 +1769,16 @@ yyerrlab:
             if (yymsg != yymsgbuf)
               YYSTACK_FREE (yymsg);
             yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, 
yymsg_alloc)));
-            if (!yymsg)
+            if (yymsg)
               {
-                yymsg = yymsgbuf;
-                yymsg_alloc = sizeof yymsgbuf;
-                yysyntax_error_status = 2;
+                yysyntax_error_status = YYSYNTAX_ERROR;
+                yymsgp = yymsg;
               }
             else
               {
-                yysyntax_error_status = YYSYNTAX_ERROR;
-                yymsgp = yymsg;
+                yymsg = yymsgbuf;
+                yymsg_alloc = sizeof yymsgbuf;
+                yysyntax_error_status = 2;
               }
           }
         yyerror (]b4_yyerror_args[yymsgp);
-- 
2.24.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]