diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2020-04-06 18:37:51 +0200 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2020-04-06 19:14:11 +0200 |
commit | 87579e03e02c7521ca3bb6ce03a0469339b9d5ce (patch) | |
tree | 7f3e71e182f2cbaf54ef3cd8aca510fe7467b951 /data/skeletons/lalr1.cc | |
parent | 11225a5d2f341fec9ad53346a17ac18c625b3f87 (diff) | |
download | bison-87579e03e02c7521ca3bb6ce03a0469339b9d5ce.tar.gz |
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.
Diffstat (limited to 'data/skeletons/lalr1.cc')
-rw-r--r-- | data/skeletons/lalr1.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/data/skeletons/lalr1.cc b/data/skeletons/lalr1.cc index 104009c9..7dfb63f7 100644 --- a/data/skeletons/lalr1.cc +++ b/data/skeletons/lalr1.cc @@ -1458,7 +1458,8 @@ b4_dollar_popdef])[]dnl if (!yyctx.lookahead ().empty ()) { - yyarg[0] = yyctx.token (); + if (yyarg) + yyarg[0] = yyctx.token (); int yyn = yyctx.yyexpected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); return yyn + 1; } |