summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--parser.l8
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 885366af..729fcc4e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2013-12-06 Kaz Kylheku <kaz@kylheku.com>
+ * parser.l (end_of_regex): Fix start condition stack underflow
+ during regex_parse.
+
+2013-12-06 Kaz Kylheku <kaz@kylheku.com>
+
* parser.l (regex_parse): Match the simplified grammar now
expected in the parser, with no slashes around the regex.
Change prefix for diagnostic message.
diff --git a/parser.l b/parser.l
index 0370bd2d..7c5a4d84 100644
--- a/parser.l
+++ b/parser.l
@@ -778,9 +778,11 @@ void end_of_regex(void)
internal_error("end_of_regex called in wrong scanner state");
yy_pop_state();
- if (yy_top_state() == INITIAL
- || yy_top_state() == QSILIT)
- yy_pop_state();
+
+ if (YYSTATE != INITIAL) {
+ if (yy_top_state() == INITIAL || yy_top_state() == QSILIT)
+ yy_pop_state();
+ }
}
void end_of_char(void)