From: Jarkko Hietaniemi Date: Sun, 9 Mar 2003 10:54:10 +0000 (+0000) Subject: From Inaba Hiroto: re_intuit_start set a value to X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=16e1b94401335fe86d42338fc14a6680fc469ab0;p=p5sagit%2Fp5-mst-13.2.git From Inaba Hiroto: re_intuit_start set a value to PL_bostr before calling find_byclass when regexp has ROPT_UTF8 flag on. But right value for PL_bostr is set before re_intuit_start is called. PL_regdata is always assigned by cache_re(), so the whole if(prog->reganch & ROPT_UTF8){} can be deleted. p4raw-id: //depot/perl@18858 --- diff --git a/regexec.c b/regexec.c index 6d18de4..4692dcd 100644 --- a/regexec.c +++ b/regexec.c @@ -852,10 +852,6 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos, char *startpos = strbeg; t = s; - if (prog->reganch & ROPT_UTF8) { - PL_regdata = prog->data; - PL_bostr = startpos; - } cache_re(prog); s = find_byclass(prog, prog->regstclass, s, endpos, startpos, 1); if (!s) { diff --git a/t/op/pat.t b/t/op/pat.t index 54f7d14..85ec2c2 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -3149,4 +3149,14 @@ ok("bbbbac" =~ /$pattern/ && $1 eq 'a', "[perl #3547]"); ok("\x{100}\n" =~ /\x{100}\n$/, "UTF8 length cache and fbm_compile"); } -# last test 995 +{ + package Str; + use overload q/""/ => sub { ${$_[0]}; }; + sub new { my ($c, $v) = @_; bless \$v, $c; } + + package main; + $_ = Str->new("a\x{100}/\x{100}b"); + ok(join(":", /\b(.)\x{100}/g) eq "a:/", "re_intuit_start and PL_bostr"); +} + +# last test 996