diff options
author | Yves Orton <demerphq@gmail.com> | 2007-06-23 19:04:04 +0000 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2007-06-23 19:04:04 +0000 |
commit | a229a030867b4d770c1ba9af02d1f32330221473 (patch) | |
tree | 0b65d32ad10f03e0045faa9b7714309fbb4a2572 /pp_hot.c | |
parent | 075d4edd61a9648945541c8a76d8c03d4588400b (diff) | |
download | perl-a229a030867b4d770c1ba9af02d1f32330221473.tar.gz |
Resolve
http://www.nntp.perl.org/group/perl.perl5.porters/2007/06/msg125667.html
by reverting part of change #29354.
Unfortunately match vars after a /g match in scalar context will be
unsafe (again) after this, but such matches on long strings won't be
as diabolically slow.
Question: why does the new test in t/op/pat.t pass, but the same test
in t/op/reg_unsafe.t fail? (Latter is TODO for now)
p4raw-link: @29354 on //depot/perl: 58e23c8d7d24dd08c87b5d56819ad45527176c15
p4raw-id: //depot/perl@31451
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -1266,9 +1266,12 @@ PP(pp_match) } } } - /* remove comment to get faster /g but possibly unsafe $1 vars after a - match. Test for the unsafe vars will fail as well*/ - if (( /* !global && */ rx->nparens) + /* XXX: comment out !global get safe $1 vars after a + match, BUT be aware that this leads to drammatic slowdowns on + /g matches against large strings. So far a solution to this problem + appears to be quite tricky. + Test for the unsafe vars are TODO for now. */ + if (( !global && rx->nparens) || SvTEMP(TARG) || PL_sawampersand || (rx->extflags & (RXf_EVAL_SEEN|RXf_PMf_KEEPCOPY))) r_flags |= REXEC_COPY_STR; |