Closed sorc1 closed 8 years ago
That fixes memleaks on invalid regexps like 'a['.
There are still Parse() memleaks but they're not related to C++ exceptions handling. For example, regexp '(' produces a memleak due to absence of %destructor rules in re_parser.y
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.