Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lexer: fix Parse() memleaks on invalid regexps
Parse() uses bison to parse regexps strings. bison clears its own state stack before exiting from yyparse(). But bison don't support C++ exceptions so its state remains uncleared if an exception is thrown from its yylex() or yyerror() callbacks. So, we have to delay a Pire::Error exception & re-throw it just after exiting from yyparse(). Delaying exceptions other than Pire::Error is out of scope of the fix.
- Loading branch information
Showing
2 changed files
with
36 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters