From: David Mitchell Date: Sat, 22 Jun 2013 16:24:13 +0000 (+0100) Subject: pp_match(): don't set REXEC_IGNOREPOS on 1st iter X-Git-Tag: upstream/5.20.0~2571^2~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=63b37c5b629988880eac5bf297d5319cbc572436;p=platform%2Fupstream%2Fperl.git pp_match(): don't set REXEC_IGNOREPOS on 1st iter Currently all core callers of regexec set both the REXEC_IGNOREPOS and REXEC_NOT_FIRST flags, or neither, depending on whether this is the first or subsequent iteration of a //g; *except* for one place in pp_match(), where REXEC_IGNOREPOS is set on the first iteration for the one specific case of /g with an anchored \G. Now AFAICT this makes no difference, because the starting position as calculated by regexec() still comes to the same value of (strbeg + pos -gofs), and the same value og ganch calculated. Also in the commit that added this particular use of the flag to pp_match, (0ef3e39ecdfec), removing the flag makes no difference to the passing or not of the new test case. So I don't understand what its purpose it, and its possibly a mistake. Removing it now makes the code simpler for further clearup. --- diff --git a/pp_hot.c b/pp_hot.c index 964a7cd..bf4aca7 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -1392,7 +1392,6 @@ PP(pp_match) if (!(RX_EXTFLAGS(rx) & RXf_GPOS_SEEN)) curpos = mg->mg_len; else if (RX_EXTFLAGS(rx) & RXf_ANCH_GPOS) { - r_flags |= REXEC_IGNOREPOS; curpos = mg->mg_len; } else if (!(RX_EXTFLAGS(rx) & RXf_GPOS_FLOAT))