diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-09-22 07:13:36 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-09-22 10:06:18 -0700 |
commit | 7e3136378328f90878eb7873a7a3197897e68253 (patch) | |
tree | 48497a02aaaaeab718fda631fa1ef9d12886e051 /pp_hot.c | |
parent | ab1d075370c212c5b4ea765c3a48fac555cd1f27 (diff) | |
download | perl-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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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); } |