From 28e6477a0324319b607c55ba4e321de615531d60 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 23 Jul 2017 11:52:31 +0300 Subject: [PATCH] Made Lemon's dynamic stack size compatible with C++ --- tools/lemon/lempar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/lemon/lempar.c b/tools/lemon/lempar.c index 93b612017..59708e222 100644 --- a/tools/lemon/lempar.c +++ b/tools/lemon/lempar.c @@ -296,10 +296,10 @@ static int yyGrowStack(yyParser *p){ newSize = p->yystksz*2 + 100; idx = p->yytos ? (int)(p->yytos - p->yystack) : 0; if( p->yystack==&p->yystk0 ){ - pNew = malloc(newSize*sizeof(pNew[0])); + pNew = (yyStackEntry *)malloc(newSize*sizeof(pNew[0])); if( pNew ) pNew[0] = p->yystk0; }else{ - pNew = realloc(p->yystack, newSize*sizeof(pNew[0])); + pNew = (yyStackEntry *)realloc(p->yystack, newSize*sizeof(pNew[0])); } if( pNew ){ p->yystack = pNew;