summaryrefslogtreecommitdiffstats
path: root/parser.l
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2013-12-06 08:59:06 -0800
committerKaz Kylheku <kaz@kylheku.com>2013-12-06 08:59:06 -0800
commit56f9944a1c2b84deb555c41a5edb287c0e6f419f (patch)
tree4076f711d28a5d72ebaa0c86a8f8e0d052c6cc53 /parser.l
parenteae5fe0959092f282ed41e333562ff649c6e0eb9 (diff)
downloadtxr-56f9944a1c2b84deb555c41a5edb287c0e6f419f.tar.gz
txr-56f9944a1c2b84deb555c41a5edb287c0e6f419f.tar.bz2
txr-56f9944a1c2b84deb555c41a5edb287c0e6f419f.zip
* parser.l (end_of_regex): Fix start condition stack underflow
during regex_parse.
Diffstat (limited to 'parser.l')
-rw-r--r--parser.l8
1 files changed, 5 insertions, 3 deletions
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)