From: David Mitchell Date: Thu, 6 Feb 2014 16:36:52 +0000 (+0000) Subject: re_intuit_start(): unconditionally init other_last X-Git-Tag: upstream/5.20.0~464^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f4bf5fc7bce4abc2119b7d08c9265b7e17285e1;p=platform%2Fupstream%2Fperl.git re_intuit_start(): unconditionally init other_last Initialise other_last to strpos at the top if the function, rather than initialising it to NULL then later setting it to strpos if NULL. Makes the code simpler. Although strpos can currently change doing execution, the conditional assignment always happens before strpos has had a chance to change. --- diff --git a/regexec.c b/regexec.c index 37253a5..54ebd36 100644 --- a/regexec.c +++ b/regexec.c @@ -644,7 +644,7 @@ Perl_re_intuit_start(pTHX_ const bool utf8_target = (sv && SvUTF8(sv)) ? 1 : 0; /* if no sv we have to assume bytes */ U8 other_ix = 1 - prog->substrs->check_ix; bool ml_anch = 0; - char *other_last = NULL; /* latest pos 'other' substr already checked to */ + char *other_last = strpos;/* latest pos 'other' substr already checked to */ 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; @@ -909,9 +909,6 @@ Perl_re_intuit_start(pTHX_ : prog->substrs->data[other_ix].substr) { /* Take into account the "other" substring. */ - if (!other_last) - other_last = strpos; - do_other_substr: { char *last, *last1;