From 6b071d16f412026593626080b01e5398a48ed780 Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Sat, 8 Mar 2014 14:38:56 +0000 Subject: [PATCH] re_intuit_start(): always initialise start_shift The start_shift variable is usually initialised to prog->check_offset_min, except for one code path where it is left at zero. It turns out that in that code path, the value isn't (currently) used, so is safe. However, that may change, so unconditionally initialise it. --- regexec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/regexec.c b/regexec.c index 123d484..48e0fcc 100644 --- a/regexec.c +++ b/regexec.c @@ -635,7 +635,7 @@ Perl_re_intuit_start(pTHX_ { dVAR; struct regexp *const prog = ReANY(rx); - SSize_t start_shift = 0; + SSize_t start_shift = prog->check_offset_min; /* Should be nonnegative! */ SSize_t end_shift = 0; /* current lowest pos in string where the regex can start matching */ @@ -805,7 +805,6 @@ Perl_re_intuit_start(pTHX_ } } - start_shift = prog->check_offset_min; /* okay to underestimate on CC */ end_shift = prog->check_end_shift; #ifdef DEBUGGING /* 7/99: reports of failure (with the older version) */ -- 2.7.4