summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2016-12-12 15:15:06 +0000
committerHugo van der Sanden <hv@crypt.org>2016-12-12 15:17:11 +0000
commitd3c48e81594c1d64ba9833495e45d8951b42027c (patch)
treee88cca5520564db9398aafb6e7a55e6222de67df
parentdd3d2a3fc516b35d3b1c2ac8dfb860b57aed3b58 (diff)
downloadperl-d3c48e81594c1d64ba9833495e45d8951b42027c.tar.gz
[perl #130307] Correctly unwind on cache hit
We've already incremented curlyx.count in the WHILEM branch before we check for a hit in the super-linear cache, so must reverse that on the sayNO.
-rw-r--r--regexec.c1
-rw-r--r--t/re/re_tests1
2 files changed, 2 insertions, 0 deletions
diff --git a/regexec.c b/regexec.c
index 2b7a200d1e..013ccc54a8 100644
--- a/regexec.c
+++ b/regexec.c
@@ -7496,6 +7496,7 @@ NULL
DEBUG_EXECUTE_r( Perl_re_exec_indentf( aTHX_ "whilem: (cache) already tried at this position...\n",
depth)
);
+ cur_curlyx->u.curlyx.count--;
sayNO; /* cache records failure */
}
ST.cache_offset = offset;
diff --git a/t/re/re_tests b/t/re/re_tests
index 1797ddc09d..e8a7fa9f34 100644
--- a/t/re/re_tests
+++ b/t/re/re_tests
@@ -1975,6 +1975,7 @@ AB\s+\x{100} AB \x{100}X y - -
\b\z0*\x{100} .\x{100} n - - # [perl #129350] crashed in intuit_start
(.*?(a(a)|i(i))n) riiaan y $2-$3-$4-$1 aa-a--riiaan # Jump trie capture buffer issue [perl #129897]
(^(?:(\d)x)?\d$) 1 y [$1-$2] [1-] # make sure that we reset capture buffers properly (from regtry)
+(X{2,}[-X]{1,4}){3,}X{2,} XXX-XXX-XXX-- n - - # [perl #130307]
# Keep these lines at the end of the file
# vim: softtabstop=0 noexpandtab