mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 14:23:04 +00:00
In impure push mode, don't allow more than one yypstate to be allocated
since multiple impure parsers would corrupt yynerrs. * data/push.c (yypstate_allocated): New static global variable initialized to 0. (yypull_parse): If yypstate_new returns 0, don't report it as memory exhaustion if yypstate_allocated is 1, but still return 2. (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is already 1. Otherwise, set it to 1. (yypstate_delete): Set it to 0. * tests/push.at (Push Parsing: Multiple impure instances): New test case.
This commit is contained in:
@@ -164,7 +164,7 @@
|
||||
typedef union YYSTYPE
|
||||
{
|
||||
|
||||
/* Line 22 of yacc.c */
|
||||
/* Line 1535 of yacc.c */
|
||||
#line 94 "parse-gram.y"
|
||||
|
||||
symbol *symbol;
|
||||
@@ -178,7 +178,7 @@ typedef union YYSTYPE
|
||||
|
||||
|
||||
|
||||
/* Line 22 of yacc.c */
|
||||
/* Line 1535 of yacc.c */
|
||||
#line 183 "parse-gram.h"
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
|
||||
Reference in New Issue
Block a user