]> git.saurik.com Git - bison.git/blobdiff - data/push.c
DJGPP spefic issue. Inhibit the use of disallowed characters for
[bison.git] / data / push.c
index 5ad906168bd84a337b72be95cc95ef2f863b5c4e..ee9aa671432318e15ffedda98fbf5ce642845360 100644 (file)
@@ -750,12 +750,12 @@ do {                                                              \
   /* The symbols being reduced.  */
   for (yyi = 0; yyi < yynrhs; yyi++)
     {
-      fprintf (stderr, "   $%d = ", yyi + 1);
+      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
                       &]b4_rhs_value(yynrhs, yyi + 1)[
                       ]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl
                       b4_user_args[);
-      fprintf (stderr, "\n");
+      YYFPRINTF (stderr, "\n");
     }
 }
 
@@ -1091,7 +1091,14 @@ b4_push_if(
 ]b4_locations_if([[  YYLTYPE yylloc;
 ]])])[
   if (yyps == 0)
-    yyps_local = yypstate_new ();
+    {
+      yyps_local = yypstate_new ();
+      if (!yyps_local)
+        {
+          yyerror (]b4_yyerror_args[YY_("memory exhausted"));
+          return 2;
+        }
+    }
   else
     yyps_local = yyps;
   do {
@@ -1108,6 +1115,8 @@ b4_push_if(
 ]b4_c_function_def([[yypstate_new]], [[yypstate *]])[
 {
   yypstate *yyps = (yypstate *) malloc (sizeof *yyps);
+  if (!yyps)
+    return 0;
   yyps->yynew = 1;
   return yyps;
 }