summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2012-05-28 10:58:06 +0200
committerYves Orton <demerphq@gmail.com>2012-05-28 11:00:42 +0200
commite8b06a558cb4e9db72f38629a92677b712e38708 (patch)
tree1a8cde9ecffd84c710ce95c90ba31c925f1c58aa
parent48f3d0c6209f4f32705fc6fa7e6d0682490d7293 (diff)
downloadperl-e8b06a558cb4e9db72f38629a92677b712e38708.tar.gz
Revert "fix [perl #76546] regex engine slowdown bug"
This reverts commit dee29c6b5bec1d6e7fccc971e31113a5d7cee844. $ perl5.16.0 -e 'warn "t/bin/good.pl syntax OK\n" =~ /syntax OK\s+\z/si' 1 at -e line 1. $ bleadperl -e 'warn "t/bin/good.pl syntax OK\n" =~ /syntax OK\s+\z/si' Warning: something's wrong at -e line 1. Will fix properly later.
-rw-r--r--regexec.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/regexec.c b/regexec.c
index 58ea4a05ff..8650654934 100644
--- a/regexec.c
+++ b/regexec.c
@@ -561,7 +561,6 @@ Perl_re_intuit_start(pTHX_ REGEXP * const rx, SV *sv, char *strpos,
I32 ml_anch;
register char *other_last = NULL; /* other substr checked before this */
char *check_at = NULL; /* check substr found at this pos */
- char *checked_upto = NULL; /* how far into the string we have already checked using find_byclass*/
const I32 multiline = prog->extflags & RXf_PMf_MULTILINE;
RXi_GET_DECL(prog,progi);
#ifdef DEBUGGING
@@ -1091,20 +1090,15 @@ Perl_re_intuit_start(pTHX_ REGEXP * const rx, SV *sv, char *strpos,
else
endpos= strend;
- if (!checked_upto)
- checked_upto = s;
- DEBUG_EXECUTE_r(PerlIO_printf(Perl_debug_log, "start_shift: %"IVdf" check_at: %"IVdf" s: %"IVdf" endpos: %"IVdf" checked_upto: %"IVdf"\n",
- (IV)start_shift, (IV)(check_at - strbeg), (IV)(s - strbeg), (IV)(endpos - strbeg), (IV)(checked_upto- strbeg)));
-
+ DEBUG_EXECUTE_r(PerlIO_printf(Perl_debug_log, "start_shift: %"IVdf" check_at: %"IVdf" s: %"IVdf" endpos: %"IVdf"\n",
+ (IV)start_shift, (IV)(check_at - strbeg), (IV)(s - strbeg), (IV)(endpos - strbeg)));
+
t = s;
- s = find_byclass(prog, progi->regstclass, checked_upto, endpos, NULL);
- if (s) {
- checked_upto = s;
- } else {
+ s = find_byclass(prog, progi->regstclass, s, endpos, NULL);
+ if (!s) {
#ifdef DEBUGGING
const char *what = NULL;
#endif
- checked_upto = endpos;
if (endpos == strend) {
DEBUG_EXECUTE_r( PerlIO_printf(Perl_debug_log,
"Could not match STCLASS...\n") );