]> git.saurik.com Git - bison.git/commitdiff
* data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 27 Feb 2006 19:50:59 +0000 (19:50 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 27 Feb 2006 19:50:59 +0000 (19:50 +0000)
led to a segmentation fault in GNU Pascal.  Problem reported
by Waldek Hebisch.

ChangeLog
data/glr.c

index d56eb26e61374aa545da72df3e2543c0cf5166e7..8a12134a599ddbb9d87b636b16262ef15f3d6b48 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-02-27  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
+       led to a segmentation fault in GNU Pascal.  Problem reported
+       by Waldek Hebisch.
+
 2006-02-21  Joel E. Denny  <jdenny@ces.clemson.edu>
 
        * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
index 3430f1bb81e227b1f4abce01d333775a8c802443..48eae8d5e0b7697ebe444ab1896cf28020d2e9d4 100644 (file)
@@ -1190,7 +1190,7 @@ yyexpandGLRStack (yyGLRStack* yystackp)
   size_t yysize, yynewSize;
   size_t yyn;
   yysize = yystackp->yynextFree - yystackp->yyitems;
-  if (YYMAXDEPTH <= yysize)
+  if (YYMAXDEPTH - YYHEADROOM < yysize)
     yyMemoryExhausted (yystackp);
   yynewSize = 2*yysize;
   if (YYMAXDEPTH < yynewSize)