summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2015-10-04 14:13:44 +0200
committerYves Orton <demerphq@gmail.com>2015-10-04 14:17:12 +0200
commit6625d92602279361acd0c6185b78c6d201fd81e0 (patch)
tree5597fc17c0b4149929d0d7628fc0dedb2e19636c /regexec.c
parent0f8d761c4673440b49eeb491136a67dcf3da7400 (diff)
downloadperl-6625d92602279361acd0c6185b78c6d201fd81e0.tar.gz
fix perl-126222 - (?!) OPFAIL optimization does work in (?(?!)yes|no)
OPFAIL should trigger the no branch when used in this context Thanks to Victor Adam for the report.
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/regexec.c b/regexec.c
index 15b28e56d1..96def0f2ca 100644
--- a/regexec.c
+++ b/regexec.c
@@ -7722,7 +7722,15 @@ NULL
/* FALLTHROUGH */
case OPFAIL: /* (*FAIL) */
- sayNO;
+ if (logical) {
+ /* deal with (?(?!)X|Y) properly,
+ * make sure we trigger the no branch
+ * of the trailing IFTHEN structure*/
+ sw= 0;
+ break;
+ } else {
+ sayNO;
+ }
/* NOTREACHED */
NOT_REACHED; /* NOTREACHED */