summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2000-08-10 20:23:04 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2000-08-11 01:22:02 +0000
commit5e39e1e56bf08c329cf6e45b28d658ce846c1e16 (patch)
tree4b407ff768cb83d2fdb0b0c41987a7cd6ed8e3fc /regexec.c
parent719c805edaeff6eec3f1035896fb6548f0740ebc (diff)
downloadperl-5e39e1e56bf08c329cf6e45b28d658ce846c1e16.tar.gz
Re: [ID 20000809.005] trouble with long string and /m modifier - uninitialized value
Message-Id: <200008101823.TAA23580@crypt.compulink.co.uk> p4raw-id: //depot/perl@6591
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/regexec.c b/regexec.c
index 002b66ac85..cbc8c199b5 100644
--- a/regexec.c
+++ b/regexec.c
@@ -690,6 +690,7 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos,
SvREFCNT_dec(prog->check_substr);
prog->check_substr = Nullsv; /* disable */
prog->float_substr = Nullsv; /* clear */
+ check = Nullsv; /* abort */
s = strpos;
/* XXXX This is a remnant of the old implementation. It
looks wasteful, since now INTUIT can use many
@@ -752,6 +753,8 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos,
"Could not match STCLASS...\n") );
goto fail;
}
+ if (!check)
+ goto giveup;
DEBUG_r( PerlIO_printf(Perl_debug_log,
"Looking for %s substr starting at offset %ld...\n",
what, (long)(s + start_shift - i_strpos)) );
@@ -762,6 +765,8 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos,
goto retry_floating_check;
/* Recheck anchored substring, but not floating... */
s = check_at;
+ if (!check)
+ goto giveup;
DEBUG_r( PerlIO_printf(Perl_debug_log,
"Looking for anchored substr starting at offset %ld...\n",
(long)(other_last - i_strpos)) );
@@ -771,6 +776,8 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos,
current position only: */
if (ml_anch) {
s = t = t + 1;
+ if (!check)
+ goto giveup;
DEBUG_r( PerlIO_printf(Perl_debug_log,
"Looking for /%s^%s/m starting at offset %ld...\n",
PL_colors[0],PL_colors[1], (long)(t - i_strpos)) );
@@ -792,8 +799,10 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos,
PerlIO_printf(Perl_debug_log,
"Does not contradict STCLASS...\n") );
}
- DEBUG_r(PerlIO_printf(Perl_debug_log, "%sGuessed:%s match at offset %ld\n",
- PL_colors[4], PL_colors[5], (long)(s - i_strpos)) );
+ giveup:
+ DEBUG_r(PerlIO_printf(Perl_debug_log, "%s%s:%s match at offset %ld\n",
+ PL_colors[4], (check ? "Guessed" : "Giving up"),
+ PL_colors[5], (long)(s - i_strpos)) );
return s;
fail_finish: /* Substring not found */