skeletons: beware not to use yyarg when it's null

Reported by Adrian Vogelsgesang.

* data/skeletons/glr.c, data/skeletons/lalr1.cc,
* data/skeletons/lalr1.java, data/skeletons/yacc.c: Here.
This commit is contained in:
Akim Demaille
2020-04-06 18:37:51 +02:00
parent 11225a5d2f
commit 87579e03e0
5 changed files with 11 additions and 7 deletions

View File

@@ -981,7 +981,9 @@ b4_dollar_popdef[]dnl
int yycount = 0;
if (yyctx.getToken () != null)
{
yyarg[yycount++] = yyctx.getToken ();
if (yyarg != null)
yyarg[yycount] = yyctx.getToken ();
yycount += 1;
yycount += yyctx.getExpectedTokens (yyarg, 1, yyargn);
}
return yycount;