summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-09-22 07:13:36 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-09-22 10:06:18 -0700
commit7e3136378328f90878eb7873a7a3197897e68253 (patch)
tree48497a02aaaaeab718fda631fa1ef9d12886e051 /pp_hot.c
parentab1d075370c212c5b4ea765c3a48fac555cd1f27 (diff)
downloadperl-7e3136378328f90878eb7873a7a3197897e68253.tar.gz
[perl #96230] Stop qr// from reusing last pattern
qr// should not be using the last-successful pattern, because it is "(?^:)", not the empty pattern. A stringified qr// does not use the last-successful pattern.
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 4100ae2449..827395f87c 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1286,8 +1286,10 @@ PP(pp_match)
- /* empty pattern special-cased to use last successful pattern if possible */
- if (!RX_PRELEN(rx) && PL_curpm) {
+ /* empty pattern special-cased to use last successful pattern if
+ possible, except for qr// */
+ if (!((struct regexp *)SvANY(rx))->mother_re && !RX_PRELEN(rx)
+ && PL_curpm) {
pm = PL_curpm;
rx = PM_GETRE(pm);
}