Improve tests for stack overflow in GLR parser.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 18 Jul 2005 18:09:40 +0000 (18:09 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 18 Jul 2005 18:09:40 +0000 (18:09 +0000)
commit6100a9aa2e68e992396e3e1da954921dc1fee801
treec393eb987d113a0504a4253f4d3ac1826afa5960
parent67fd79c42743952d58ca53e3a97a8b66ee31bcc6
Improve tests for stack overflow in GLR parser.
Problem reported by twlevo@xs4all.nl.
* data/glr.c (struct yyGLRStack): Remove yyerrflag member.
All uses removed.
(yyStackOverflow): Just longjmp, but with value 2 so that caller
can handle the problem.
(YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
(yyparse): New local variable yyresult to record the result.
Use result of setjmp to set it, rather than storing itinto
struct.
(yyDone): Remove label.
(yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
to mimic yacc.c.  Do not discard lookahead if it's EOF (possible
if YYABORT is used).
* tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
yyparse status; put status > 1 into diagnostic.
Check that status==2 works.
* tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
Use exit status 3 for failure to open (which shouldn't happen).
ChangeLog
data/glr.c
tests/actions.at
tests/calc.at
tests/cxx-type.at
tests/glr-regression.at