From: Paul Eggert Date: Mon, 27 Feb 2006 19:50:59 +0000 (+0000) Subject: * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that X-Git-Tag: v2.3b~443 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/18d9185cae4c43684e4a2a134dd3090b55307586?ds=inline * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that led to a segmentation fault in GNU Pascal. Problem reported by Waldek Hebisch. --- diff --git a/ChangeLog b/ChangeLog index d56eb26e..8a12134a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-02-27 Paul Eggert + + * 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 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a diff --git a/data/glr.c b/data/glr.c index 3430f1bb..48eae8d5 100644 --- a/data/glr.c +++ b/data/glr.c @@ -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)