]> git.saurik.com Git - bison.git/commit - tests/push.at
In impure push mode, don't allow more than one yypstate to be allocated
authorJoel E. Denny <jdenny@ces.clemson.edu>
Sat, 18 Aug 2007 00:45:52 +0000 (00:45 +0000)
committerJoel E. Denny <jdenny@ces.clemson.edu>
Sat, 18 Aug 2007 00:45:52 +0000 (00:45 +0000)
commit1b17b01d0fa00512e2d7b561757336bff9784fa0
tree2190dc46c36b01cfea52c7d9da9ebdf57a2f981b
parent9987d1b3cce14fd74c4bc382048254697c2de945
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.
ChangeLog
data/push.c
src/parse-gram.c
src/parse-gram.h
tests/push.at