]> git.saurik.com Git - bison.git/commit
(YYSIZE_MAXIMUM): New macro.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 20 Sep 2005 06:06:42 +0000 (06:06 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 20 Sep 2005 06:06:42 +0000 (06:06 +0000)
commitb4c1f9d2b647df6b70732d76bbf5bc9b21372e9a
tree39562f9bc9b14581a6aa860fb49d21682bbd1266
parent8a2800e787cfb3e8f59480b8f50ba204e01f9071
(YYSIZE_MAXIMUM): New macro.
(YYSTACK_ALLOC_MAXIMUM): Use it.
(yysyntax_error): New function.
(yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
multiple syntax errors are reported, and alloca is being used.
Instead, reallocate buffers twice as big each time, so that
we waste at most half the allocated memory.  Start with a small
(128-byte) buffer that will suffice in most cases anyway.
Use yysyntax_error to do most of the work.
data/yacc.c