Fixing Perl5 Core Bugs: Report for Month 28
Fri, 13-Jul-2012 by
Karen Pauley
edit post
_Dave Mitchell writes:_
As per my grant conditions, here is a report for the June period.
This month saw the final merging of my re_eval branch back into blead, and incorporated in the 5.17.1 release. This consisted of about 125 commits, spread out over a year. The remainder of the month was spent fixing some of the issues thrown up by the new implementation.
Some highlights of the new @/(?{})/@ implementation are:
Code blocks within patterns are now parsed in the same pass as the surrounding code; in particular it is no longer necessary to have balanced braces: this now works:
@/(?{ $x='{' })/@
This means that this error message is longer generated:
@Sequence (?{...}) not terminated or not {}-balanced in regex@
but a new error may be seen:
@Sequence (?{...}) not terminated with ')'@
In addition, literal code blocks within run-time patterns are only compiled once, at perl compile-time:
bc. for my $p (...) {
# this 'FOO' block of code is compiled once, at the same time as
# the surrounding 'for' loop
/$p{(?{FOO;})/;
}
Lexical variables are now sane as regards scope, recursion and closure behaviour. In particular, @/A(?{B})C/@ behaves (from a closure viewpoint) exactly like @/A/ && do { B } && /C/@, while @qr/A(?{B})C/@ is like @sub {/A/ && do { B } && /C/}@. So this code now works how you might expect, creating three regexes that match 1,2, and 3:
bc. for my $i (0..2) {
push @r, qr/^(??{$i})$/;
}
"1" =~ $r[1]; # matches
The @use re 'eval'@ pragma is now strictly only required for code blocks defined at runtime; in particular in the following, the text of the @$r@ pattern is still interpolated into the new pattern and recompiled, but the individual compiled code-blocks within @$r@ are reused rather than being recompiled, and @use re 'eval'@ isn't needed any more:
bc. my $r = qr/abc(?{....})def/;
/xyz$r/;
Flow control operators no longer crash. Each code block runs in a new dynamic scope, so @next@ etc. will not see any enclosing loops and @caller@ will not see any calling subroutines. @return@ returns a value from the code block, not from any enclosing subroutine.
Over the last month I have averaged 15 hours per week.
As of 2012/06/31: since the beginning of the grant:
bq. 120.9 weeks
1300.0 total hours
10.8 average hours per week
There are now 0 hours left on the grant (but the grant has just been extended :-)
Report for period 2012/06/01 to 2012/06/30 inclusive
**Summary**
Effort (HH::MM):
bq. 23:50 diagnosing bugs
39:03 fixing bugs
0:00 reviewing other people's bug fixes
0:00 reviewing ticket histories
0:00 review the ticket queue (triage)
-----
**62:53 Total**
**Numbers of tickets closed:**
bq. 4 tickets closed that have been worked on
0 tickets closed related to bugs that have been fixed
0 tickets closed that were reviewed but not worked on (triage)
-----
**4 Total**
[actually, an additional 25 tickets were closed, but I forgot to update my automatic log]
**Short Detail**
bq. 8:42 [perl #3634] Capture corruption through self-modying regexp (?{...})
36:41 [perl #34161] METABUG - (?{...}) and (??{...}) regexp issues
4:25 [perl #113670] Bleadperl v5.17.0-451-gf6033a9 breaks SBECK/Date-Manip-6.32.tar.gz
2:00 [perl #113676] Bleadperl v5.17.0-383-g9f14173 breaks PARDUS/File-MimeInfo/File-MimeInfo-0.16.tar.gz
10:05 [perl #113682] Bleadperl v5.17.0-424-gd24ca0c breaks ABIGAIL/Regexp-Common-2011121001.tar.gz
1:00 [perl #113720] perl dumping core in regex et al(mem corruption?)
Comments (0)