Karl Williamson [Thu, 3 Mar 2011 05:14:24 +0000 (22:14 -0700)]
mktables: force code point tables are range size 1
As stated in the comment, the Perl core is expecting a different
range value definition than this program outputs. But this isn't a
problem if the range size is set to 1. Currently the core only reads in
tables that map to code points, so do it only for them.
Karl Williamson [Thu, 3 Mar 2011 05:07:27 +0000 (22:07 -0700)]
mktables: Nits in comment, white space
Karl Williamson [Thu, 3 Mar 2011 05:05:29 +0000 (22:05 -0700)]
UCD.pm: nits in comments and pod
Karl Williamson [Thu, 3 Mar 2011 05:02:12 +0000 (22:02 -0700)]
regexec.c: Remove '#if 0' code
This code was retained for a while until it was clear that the replacement
code worked.
Karl Williamson [Thu, 3 Mar 2011 05:00:36 +0000 (22:00 -0700)]
regcomp.c: Remove #if 0 code
This code is obsolete, as new code has been written to do folding;
now that smokes are all passing with that new code, there is no point to
retaining the old.
Nicholas Clark [Wed, 2 Mar 2011 17:25:17 +0000 (17:25 +0000)]
Eliminate the global error override $Error from t/re{ReTest.pl,pat.t}
For the 5 use points, convey the information by appending to $Message, which
all are already using.
Nicholas Clark [Wed, 2 Mar 2011 17:15:19 +0000 (17:15 +0000)]
Simplify pat.t by removing a loop over 2 items, which is mostly if/else
Karl Williamson [Wed, 2 Mar 2011 15:15:55 +0000 (08:15 -0700)]
Revert "In File::Copy, convert two regexps to explicit ranges, instead of using /i"
This reverts commit
7b7d8b152c027b50b260244da6f7c17a010279d6.
The performance issue that prompted this commit has been fixed.
Karl Williamson [Wed, 2 Mar 2011 15:15:05 +0000 (08:15 -0700)]
Revert "In Cwd, convert two regexps to explicit ranges, instead of using /i"
This reverts commit
be6c6a23f06d680159ce323c1906d297abbe85cd.
The performance issue that prompted this commit has been fixed.
Nicholas Clark [Wed, 2 Mar 2011 13:46:10 +0000 (13:46 +0000)]
Fix the TODO handling in t/re/ReTest.pl's skip()
It now does TODO & SKIP. However, currently I believe that nothing that uses it
is calling skip() with a TODO test.
Nicholas Clark [Mon, 28 Feb 2011 16:31:19 +0000 (16:31 +0000)]
Convert taint.t to lexical file and directory handles, and 3 argument open.
Retain tainting tests for package filehandles - augment these with analogous
tests for lexical filehandles.
Drop the use of File::Spec::Functions to determine a portable path for
'./TEST', added as part of the MacOS classic porting. We haven't built on
classic for many years, and the change itself was over-engineering - the
better fix at the time would have been to replace './TEST' with 'TEST'.
Nicholas Clark [Mon, 28 Feb 2011 16:08:29 +0000 (16:08 +0000)]
In taint.t, convert the Fcntl and *printf tests to violates_taint().
Nicholas Clark [Mon, 28 Feb 2011 14:49:43 +0000 (14:49 +0000)]
In taint.t, violates_taint() now tests more of the "insecure dependency" error.
Use the second parameter to determine the string to look for in the error
message, and add an optional third parameter for the test description, if it
should differ from the error message string.
Nicholas Clark [Mon, 28 Feb 2011 14:44:38 +0000 (14:44 +0000)]
In taint.t, add violates_taint(), to replace a repeated is()/like() pair.
Nicholas Clark [Mon, 28 Feb 2011 13:22:34 +0000 (13:22 +0000)]
In taint.t, avoid using ok() where better test functions are more suitable.
Nicholas Clark [Mon, 28 Feb 2011 13:17:14 +0000 (13:17 +0000)]
In taint.t, replace C<not any_tainted(..)> with calls to isnt_tainted()
Change tainted() to perform the actual test for tainting, eliminate all other
uses of any_tainted() and remove it.
Nicholas Clark [Mon, 28 Feb 2011 11:57:32 +0000 (11:57 +0000)]
In taint.t, replace calls to all_tainted() with a loop over is_tainted().
Nicholas Clark [Mon, 28 Feb 2011 11:50:38 +0000 (11:50 +0000)]
Add {is,isnt}_tainted() to taint.t, to replace use of C<ok(tainted(...))>
Nicholas Clark [Sat, 26 Feb 2011 10:46:52 +0000 (10:46 +0000)]
Convert taint.t to use test.pl's testing functions.
This eliminates the local sub test().
Chris 'BinGOs' Williams [Tue, 1 Mar 2011 21:39:52 +0000 (21:39 +0000)]
Update perldelta for Locale::Codes update
Sullivan Beck [Tue, 1 Mar 2011 21:05:43 +0000 (16:05 -0500)]
PATCH: Bump Locale-Codes from 3.15 to 3.16
Attached is a patch to upgrade the Locale-Codes distribution (containing
the core modules Locale::Country, Locale::Language, and
Locale::Currency) to the most recent version.
====
Background:
The core modules Locale::Country, Locale::Language, and Locale::Currency
(all part of the Locale-Codes distribution) should be updated on a
regular basis. They contain "codes" from various internet standards
which change over time.
I plan on releasing new versions at least twice a year to keep the codes
up-to-date. At this point, I'm not planning on any significant code
changes (other than bug fixes), so the only significant changes
between releases should be to update the codes.
!DSPAM:
4d6d635562584214713763!
>From
5f7e59eac34b1b322f80686fbf431569789c222a Mon Sep 17 00:00:00 2001
From: Sullivan Beck <sbeck@cpan.org>
Date: Tue, 1 Mar 2011 15:56:18 -0500
Subject: [PATCH] Bump Locale-Codes from 3.15 to 3.16
Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
Karl Williamson [Tue, 1 Mar 2011 17:03:25 +0000 (10:03 -0700)]
toke.c: Raise error for multiple regexp mods
When the new regular expression modifiers being allowed in suffix-form
were added on a very tight schedule, it was with the understanding that
the error checking that only one can occur per regular experssion would
be added later. This accomplishes that.
Karl Williamson [Tue, 1 Mar 2011 15:53:05 +0000 (08:53 -0700)]
UCD.pm: Convert charscript to use mktables tables
This removes the need for Scripts.txt
Karl Williamson [Tue, 1 Mar 2011 15:23:21 +0000 (08:23 -0700)]
UCD.pm: Bump version
Karl Williamson [Tue, 1 Mar 2011 14:56:52 +0000 (07:56 -0700)]
Revert "mktables: Default map tables to range size 1."
This reverts commit
cef6a343d5e19fe2dc2c3655ecf621c8ff26f252.
This commit had the unintended consequence of greatly increasing
the disk space used; the code in UCD.pm that didn't like ranges has now
been changed to accept them. The tables that the swashes currently
read already had been set to not put out ranges. If other tables
eventually do get read by swashes, things will have to be resolved at
that time.
Karl Williamson [Tue, 1 Mar 2011 14:50:11 +0000 (07:50 -0700)]
UCD.pm: Convert num() to use new fcn
A new function that reads mktables files has been created. Switch to
use this.
A test is added to make sure it's working right
Karl Williamson [Tue, 1 Mar 2011 14:45:45 +0000 (07:45 -0700)]
UCD.pm: Add internal fcn for reading mktables file
Chris 'BinGOs' Williams [Tue, 1 Mar 2011 13:17:36 +0000 (13:17 +0000)]
Update Maintainers.pl and perldelta for Math::BigInt::FastCalc update
Peter John Acklam [Tue, 1 Mar 2011 13:15:47 +0000 (13:15 +0000)]
[perl #85118] [PATCH] Update Math::BigInt::FastCalc to CPAN version 0.28
Add Perl v5.6 compatibility code to FastCalc.xs (Closes RT #63859).
Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
brian d foy [Tue, 1 Mar 2011 08:46:27 +0000 (02:46 -0600)]
Point people to perlop for here doc errors
This makes this long warning slightly more useful:
Can't find string terminator %s anywhere before EOF
brian d foy [Tue, 1 Mar 2011 06:49:49 +0000 (00:49 -0600)]
Note here docs need a line separator after the last token
Karl Williamson [Mon, 28 Feb 2011 17:42:28 +0000 (10:42 -0700)]
regex: Remove obsolete code
This code has been rendered obsolete in 5.14 by using a different
mechanism altogether. This functionality is now provided at run-time,
user-selectable, via the /u and /d regex modifiers. This code was
for compile-time selection of which to use.
Karl Williamson [Mon, 28 Feb 2011 17:39:02 +0000 (10:39 -0700)]
fold_grind: Remove more tests under /d
This removes tests that cross the boundary between ascii and above latin1,
under /d, as they aren't testing different code than already tested under
/u
Karl Williamson [Mon, 28 Feb 2011 16:58:44 +0000 (09:58 -0700)]
fold_grind.t: Reduce some tests.
/d executes different code form /u really only when there are things in the
latin1 range; so the successes/failures of it should match those of /u for
things outside that
Karl Williamson [Mon, 28 Feb 2011 16:58:01 +0000 (09:58 -0700)]
fold_grind.t: Clarify comment
Karl Williamson [Mon, 28 Feb 2011 16:55:47 +0000 (09:55 -0700)]
fold_grind.t: fix confusingly-named variable
Karl Williamson [Mon, 28 Feb 2011 16:26:43 +0000 (09:26 -0700)]
regexec.c: remove no longer needed code
The code dealing with the sharp ss is now handled by the ANYOFV node,
and shouldn't appear here.
Karl Williamson [Mon, 28 Feb 2011 16:25:03 +0000 (09:25 -0700)]
regcomp.c: white space only
A previous commit collapsed nested blocks. This outdents the nested
part
Karl Williamson [Mon, 28 Feb 2011 15:40:30 +0000 (08:40 -0700)]
regcomp.c: collapse two blocks
An earlier commit removed code so that these two blocks can be written
as one.
Karl Williamson [Mon, 28 Feb 2011 15:38:30 +0000 (08:38 -0700)]
regcomp.c: Remove temporary code
This code was inserted to make sure no tests failed in the intermediate
commits leading up to
d50a4f90cab527593b2dd218f71b66a6be555490, and
should have been removed in that commit, but I forgot to.
Chris 'BinGOs' Williams [Mon, 28 Feb 2011 15:17:27 +0000 (15:17 +0000)]
Update CPANPLUS to CPAN version 0.9102
[DELTA]
Changes for 0.9102 Mon Feb 28 11:35:43 2011
================================================
* Only send NAs for a 'perl' prereq when it actually is
Not Applicable
Chris 'BinGOs' Williams [Mon, 28 Feb 2011 15:12:22 +0000 (15:12 +0000)]
Update CPANPLUS::Dist::Build to CPAN version 0.54
[DELTA]
0.54 Mon Feb 28 11:52:04 GMT 2011
- Only skip 'perl' as a prereq when CPANPLUS version is
less than 0.9102
Nicholas Clark [Mon, 28 Feb 2011 15:17:17 +0000 (15:17 +0000)]
Convert the taint.t Fcntl tests to use tempfile(), instead of "foo".
tempfile() also automatically deletes all of its temporary files.
brian d foy [Mon, 28 Feb 2011 14:50:26 +0000 (08:50 -0600)]
Fix a grammar nit in perlfaq8
Nicholas Clark [Mon, 28 Feb 2011 14:05:38 +0000 (14:05 +0000)]
Correct taint.t to skip the truncate test if $Config{d_truncate} is false.
Previously it had a comment, present since 5.003_92, that "There is no feature
test in $Config{} for truncate, so we allow for the possibility that it's
d missing."
This was never correct, as 5.000 had d_truncate, and taint.t had analogous
tests for $Config{d_chown} etc.
Chris 'BinGOs' Williams [Mon, 28 Feb 2011 11:25:33 +0000 (11:25 +0000)]
Corrected an incredibly small error in perlport.pod
Florian Ragwitz [Mon, 28 Feb 2011 10:37:07 +0000 (11:37 +0100)]
Ignore ExtUtils::Command release tests
Florian Ragwitz [Mon, 28 Feb 2011 10:31:46 +0000 (11:31 +0100)]
Upgrade Devel::DProf from version
20110225.01 to
20110228.00
Florian Ragwitz [Mon, 28 Feb 2011 10:30:03 +0000 (11:30 +0100)]
Ignore DProf release tests
Florian Ragwitz [Mon, 28 Feb 2011 09:53:40 +0000 (10:53 +0100)]
Upgrade ExtUtils::Command from version 1.16 to 1.17
Nicholas Clark [Mon, 28 Feb 2011 10:06:35 +0000 (10:06 +0000)]
Simplify the regression tests added in
3e6bd4bfcd175c61.
Unwind the innermost loop, used only for reporting, and remove the array @s,
only used to accumulate results for that loop. Fewer lines, less complexity,
better diagnostics, and with the same failure cases on
3e6bd4bfcd175c61^.
Karl Williamson [Mon, 28 Feb 2011 01:44:43 +0000 (18:44 -0700)]
Handle [folds] of 0-255 without swashes
Commit
56ca34cada940c7f6aae9a59da266e541530041e had the side effect of
causing regular expressions with things like [a-z], or even just [k] to
go out to disk to read tables to create swashes because it knew that
some of those characters matched outside the bitmap (and due to
l1_char_class_tab.h it knew which ones had those matches), but it didn't
know what the characters were that participated in those folds.
This patch hard-codes the Unicode 6.0 rules into regcomp.c for the
code points 0-255, so that the very slow utf8_heavy is not invoked on
them. (Code points above 255 will continue to invoke it.) It would,
of course, be better if these rules could be regen'd into regcomp.c, as
there is a risk that the standard will change, and the code will not.
But I don't think that has ever happened; in other words, I think that
the rules haven't changed so far since Day 1 of Unicode. (That would
not be the case if we were doing simple case folding, as the capital
sharp ss which folds to U+00DF was added later.) And the Standard is
getting more stable in this area. I believe one of their stability
policies now forbid them from adding something that simply folds to
one of the characters that already has a fold, such as M and m.
Ligatures are frowned on, and I doubt that new ones would be encoded,
so that leaves a new Unicode character that folds to a Latin-1 plus some
sort of mark. For those, this code is a no-op, so those aren't a
problem either.
Karl Williamson [Mon, 28 Feb 2011 01:31:51 +0000 (18:31 -0700)]
regcomp.c: Add deprecation macro with extra param
Karl Williamson [Sun, 27 Feb 2011 22:19:04 +0000 (15:19 -0700)]
regcomp.c: More prep for bitmap/nonbitmap folds
This sets things up in preparation for a future commit that will
move calculating all folds involving characters in the bit map.
Karl Williamson [Sun, 27 Feb 2011 21:21:47 +0000 (14:21 -0700)]
regcomp.c: Place marker for 2nd inversion list
The set_regclass_bit functions will be adding to a new inversion list.
This declares that list and passes it to them.
Karl Williamson [Sun, 27 Feb 2011 21:12:57 +0000 (14:12 -0700)]
Change to use new add_cp_to_invlist()
Karl Williamson [Sun, 27 Feb 2011 21:04:26 +0000 (14:04 -0700)]
regcomp.c: Add parameters to fcns
A pointer to the list of multi-char folds in an ANYOF node is now passed
to the routines that set the bit map. This is in preparation for those
routines to add to the list
Karl Williamson [Sun, 27 Feb 2011 20:55:03 +0000 (13:55 -0700)]
regcomp.c: Convert old-style to inversion list
The code that handles a false range in a [character class] hadn't been
converted to use inversion lists
Karl Williamson [Mon, 28 Feb 2011 00:51:33 +0000 (17:51 -0700)]
regcomp.c: Add fcn add_cp_to_invlist()
This is just an inline shorthand when a single code point is all that is
needed. A macro could have been used instead, but this just seemed nicer.
Karl Williamson [Mon, 28 Feb 2011 00:45:46 +0000 (17:45 -0700)]
regcomp.c: Move code to common place
THis is part of the refactoring of the code that sets the alternate array
for multi-char folds. Changing the node type to ANYOFV can be done at
the last second, in pass 2, as it doesn't change any sizing, etc.
Karl Williamson [Sun, 27 Feb 2011 20:12:49 +0000 (13:12 -0700)]
regcomp.c: Factor code into a function.
A future commit uses this same code, so put it into a common place.
Karl Williamson [Sun, 27 Feb 2011 05:02:26 +0000 (22:02 -0700)]
Add #defines for 2 Latin1 chars
These will be used in a future commit; the ordinals are different on
EBCDIC vs. ASCII
Karl Williamson [Sun, 27 Feb 2011 02:38:29 +0000 (19:38 -0700)]
Move some #defines
These were defined in a .c, but now there is need for them in another .c,
so move them to a header.
Karl Williamson [Sat, 26 Feb 2011 17:21:09 +0000 (10:21 -0700)]
regcomp.c: Remove no longer necessary tests
A previous commit changed add_range_to_invlist() to do the creation
that these lines did.
Karl Williamson [Sat, 26 Feb 2011 17:16:20 +0000 (10:16 -0700)]
regcomp.c: accept NULL as inversion list param
Change the function add_range_to_invlist() to accept NULL as the
inversion list, in which case it creates it. A common usage of this
function is to create the list if it doesn't exist before calling it, so
this just makes that code once.
Nicholas Clark [Sun, 27 Feb 2011 11:54:05 +0000 (11:54 +0000)]
Eliminate tests for tainting of globs, skipped since 1999.
Commit
72b166521443a1b8 changed perl to using File::Glob to implement the glob
builtin. Previously glob was implemented by spawning a csh, hence globbing was
not allowed on tainted values. The test for this was skipped, but never removed.
Nicholas Clark [Sun, 27 Feb 2011 21:36:01 +0000 (21:36 +0000)]
In gv_autoload4(), ensure set magic is called on $...::AUTOLOAD if necessary.
Without this, if $...::AUTOLOAD ever becomes tainted, it will never
subsequently become properly untainted. This fixes an omission in change
5d121f7f3e622b95.
Chris 'BinGOs' Williams [Sun, 27 Feb 2011 21:34:43 +0000 (21:34 +0000)]
Maintainers.pl and perldelta updates for Math::BigInt::FastCalc upgrade
Peter John Acklam [Sat, 26 Feb 2011 23:36:42 +0000 (15:36 -0800)]
Update Math::BigInt::FastCalc to CPAN version 0.25
# New Ticket Created by (Peter J. Acklam)
# Please include the string: [perl #84982]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=84982 >
Remove _new() from XS code and use _new() in Math::BigInt::Calc
instead. The XS _new() doesn't handle integers that are too large to
be represented exactly as floating point numbers, but small enough
to be represented as 64 bit integers. E.g., even with 64 bit integer
support, applying _num() to
18446744073709551615 (= 2**64-1) gives
1.
84467440737096e+19, not
18446744073709551615. The XS _new() also
returns nan, not inf, when it overflows. This closes RT #63335 and
RT #49569.
Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
Chris 'BinGOs' Williams [Sun, 27 Feb 2011 13:31:55 +0000 (13:31 +0000)]
Added GNU/kFreeBSD to list of systems where 5.12.x builds
Father Chrysostomos [Sun, 27 Feb 2011 08:50:08 +0000 (00:50 -0800)]
[perl #76814] FETCH called twice - ||
The || case in t/op/tie_fetch_count.t is not a bug, as there are two
separate operators operating on it in the test script. In
$dummy = $x || $y
The || does mg_get($x). If it’s true it returns it and the = does
mg_get($x). If $x is false, then $y is returned, so magic is called
once on each of $x and $y. Similarly, && will seemingly call
mg_get($x) twice if $x is false.
If you just write:
$x || $y
then magic is only called once on $x.
This patch corrects the test.
Father Chrysostomos [Sun, 27 Feb 2011 08:35:26 +0000 (00:35 -0800)]
[perl #79442] A #line "F" in a string eval doesn't update *{"_<F"}
There are two problems here.
String evals do not populate @{"_<..."} arrays the way parsed streams
do. The lines are all put into the array before the parse. Commit
e66cf94 added the code to copy (actually alias, but whatever) the
lines into the new array when a #line directive is encountered. Inte-
restingly, the following commit (8a5ee59) wrapped that code in an
#ifndef USE_ITHREADS block, because ‘[c]hange 25409 [e66cf94] wasn’t
necessary for threaded perls’. It seems it *was* necessary for
threaded perls after all, because the lines are simply not copied.
In non-threaded perls it wasn’t working properly either. The array
in the new glob was the same array as the old (aliased), so the line
numbers would be off if the #line directive contained a line number
that differed.
This commit does three things:
• It removes the #ifndef,
• It checks whether the line number has changed and aliases the indi-
vidual elements of the array.
• The breakpoints hash is not copied if the line number differs, as
setting a breakpoint on (eval 1):1 (warn 1) in
eval qq{warn 1;\n#line 1 "foo"\nwarn 2;}
should not also set a breakpoint on foo:1 (warn 2).
Karl Williamson [Sat, 26 Feb 2011 23:26:22 +0000 (16:26 -0700)]
regexec.c: Array declared 1 too small
The bounds of this array were being exceeded causing smoke failures on
netbsd
Reini Urban [Sat, 26 Feb 2011 12:55:41 +0000 (13:55 +0100)]
Modern cygwin often has empty $ENV{CYGWIN}
Fixes Use of uninitialized value $ENV{"CYGWIN"} in concatenation (.) or string
at /usr/lib/perl5/5.13.10/i686-cygwin/Config_heavy.pl line 54
Father Chrysostomos [Sat, 26 Feb 2011 06:31:02 +0000 (22:31 -0800)]
Stop aelemfast from crashing on GVs with null AVs
As reported at nntp://nntp.perl.org/
1298599236.4753.72.camel@p100 (and
respaced for readability):
#!perl5.12.0
$r=q/
print __FILE__;
local *dbline = $main::{"_<".__FILE__};
print $dbline[0]
/;
eval $r;'
__END__
(eval 1)
Bus error
This only seems to happen in non-threaded perls.
It can be reduced to this:
*d = *a; print $d[0];
The $d[0] is optimised into an aelemfast op (instead of the usual aelem
with an rv2av kid). pp_aelemfast is at fault, as evidenced by the fact
that this does not crash (the ${\...} prevents the optimisation):
*d = *a; print $d[${\0}];
pp_aelemfast uses GvAV instead of GvAVn. Usually $d[0] will autovivify
@d, but the glob assignment leaves $d[0] pointing to a glob (*d) with
no array. Then pp_alemfast passes a null pointer around.
Florian Ragwitz [Sat, 26 Feb 2011 08:05:12 +0000 (09:05 +0100)]
Don't include commit IDs in generated delta entries
We don't usually reference git commits anymore in perldelta, so let's stop
git-deltatool from generating entries like that.
Florian Ragwitz [Sat, 26 Feb 2011 07:58:16 +0000 (08:58 +0100)]
Hack to allow git-deltatool to spawn 'emacsclient -t'
My $EDITOR is 'emacsclient -t'. system('emacsclient -t', 'more', 'args') won't
do the right thing.
Florian Ragwitz [Sat, 26 Feb 2011 07:50:36 +0000 (08:50 +0100)]
Allow reviewing of diffs in the deltatool
The pager code is mostly stolen from Prophet::CLI.
Father Chrysostomos [Sat, 26 Feb 2011 05:52:22 +0000 (21:52 -0800)]
Reword perltie/READLINE and correct example
Kevin Ryde [Sat, 26 Feb 2011 05:50:50 +0000 (21:50 -0800)]
[perl #84942] perltie.pod READLINE list context
In perltie.pod the handle READLINE says
The method should return undef when there is no more data.
which made me think that's what it should always do, and didn't need to
pay attention to wantarray().
If I'm not mistaken in list context READLINE should return empty list
for no more data. It'd be good if the docs noted that, and perhaps
cross referenced to perlfunc for the gory details of what readline
should do.
Maybe something like the following, unless someone can think of a better
contrivance for the sample.
Father Chrysostomos [Sat, 26 Feb 2011 05:49:17 +0000 (21:49 -0800)]
Add Kevin Ryde to AUTHORS
Father Chrysostomos [Sat, 26 Feb 2011 04:45:08 +0000 (20:45 -0800)]
[perl #84746] Accessing $2 causes the interpreter to crash
Actually, it doesn’t. The original test case was:
#!/usr/bin/perl
my $rx = qr'\$ (?| {(.+?)} | (.+?); | (.+?)(\s) )'x;
my $test = '/home/$USERNAME ';
die unless $test =~ $rx;
print "1: $1\n";
print "2: $2\n" if defined $2;
This crashes even if I put an ‘exit’ right after the pattern match.
What’s happening is that regcomp miscounts the number of capturing
parenthesis pairs (cf. [perl #59734]), so the execution of the regular
expression causes a buffer overflow which overwrites the op_sibling
field of the regcreset op, causing a crash when the op is freed. (The
exact failure may differ between builds, platforms, etc., of course.)
S_reg in regcomp.c keeps a count of the parenthesised groups in a
(?|...) construct, which it updates after each branch, if that branch
has more captures than any previous branch. But it was not updating
the count after the last branch.
So this bug would occur if the last branch had more capturing paren-
theses than any previous branch.
Commit ee91d26, which fixed bug #59734, only solved the problem when
there was just one branch (by updating the count before the loop that
deals with subsequent branches was entered).
This commit changes the code at the end of S_reg to take into account
that RExC_npar (the current paren count) might have been increased by
the last branch.
Since the loop to deal with subsequent branches resets the count
*before* each branch, the code that commit ee91d26 added is no longer
necessary, so this commit removes it.
Karl Williamson [Sat, 26 Feb 2011 03:31:30 +0000 (20:31 -0700)]
bleadperl breaks RCLAMP/Text-Glob
This was from commit
f424400810b6af341e96230836690da51c37b812
which came from needing a bit in an already-full flags field,
and my faulty analysis that two bits could be shared. I found another
mechanism to free up another bit, and now can separate these shared
bits again.
Karl Williamson [Sat, 26 Feb 2011 03:10:47 +0000 (20:10 -0700)]
Free up bit in ANYOF flags
This is the foundation for fixing the regression RT #82610. My analysis
was wrong that two bits could be shared, at least not without further
work. This changes to use a different mechanism to pass needed
information to regexec.c so that another bit can be freed up and, in a
later commit, the two bits can become unshared again.
The bit that is freed up is ANYOF_UTF8, which basically said there is
something that is matched outside the ANYOF bitmap, and requires the
target string to be in utf8. This changes things so the existence of
something besides the bitmap indicates this, and so no flag is needed.
The flag bit ANYOF_NONBITMAP_NON_UTF8 remains to indicate that there is
something that should be matched outside the bitmap even if the target
string isn't in utf8.
Karl Williamson [Sat, 26 Feb 2011 03:02:59 +0000 (20:02 -0700)]
regcomp.c: ANYOF node handle range to UV_MAX
Karl Williamson [Fri, 25 Feb 2011 18:52:35 +0000 (11:52 -0700)]
regcomp.c: Move inversion list conversion code
This just moves the code to later in the subroutine, in preparation for future commits
Karl Williamson [Fri, 25 Feb 2011 18:42:02 +0000 (11:42 -0700)]
regcomp.c: Use more precise ANYOF flag
As the comment above the changed line says, \p doesn't have to match only
utf8, but it sets the flag that is two bits, meaning UTF8. Set just the
one flag.
Karl Williamson [Fri, 25 Feb 2011 17:46:34 +0000 (10:46 -0700)]
regcomp.c: Add comment
Florian Ragwitz [Fri, 25 Feb 2011 17:30:18 +0000 (18:30 +0100)]
Upgrade Tie::RefHash from version 1.38 to 1.39
Florian Ragwitz [Fri, 25 Feb 2011 17:07:18 +0000 (18:07 +0100)]
Upgrade Devel::DProf to version
20110225.01
We needed another upload to fix a PAUSE indexing problem.
Florian Ragwitz [Fri, 25 Feb 2011 16:28:36 +0000 (17:28 +0100)]
DProf is now maintained on CPAN, not by p5p anymore
Florian Ragwitz [Fri, 25 Feb 2011 16:27:54 +0000 (17:27 +0100)]
Remove DProf's Changes file
From now on all changes will go through CPAN first and the Changes file is being
maintained there. No need to keep it around in the core.
Florian Ragwitz [Fri, 25 Feb 2011 15:47:01 +0000 (16:47 +0100)]
Remove DProf's Makefile.PL
make_ext.pl can generate it for us.
Chris 'BinGOs' Williams [Fri, 25 Feb 2011 16:43:41 +0000 (16:43 +0000)]
Maintainers.pl and perldelta updates for Math::BigInt update
Peter John Acklam [Thu, 24 Feb 2011 12:52:17 +0000 (04:52 -0800)]
Update Math::BigInt to CPAN version 1.993
# New Ticket Created by (Peter J. Acklam)
# Please include the string: [perl #84844]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=84844 >
Change default backend library from Math::BigInt::FastCalc to
Math::BigInt::Calc, which is included in the Math-BigInt distro.
This avoids recursive distribution dependency (RT #65976).
Nicholas Clark [Fri, 25 Feb 2011 16:35:06 +0000 (16:35 +0000)]
Eliminate $::PatchId from t/re/*.t.
It was only being used in four places across two files, to add perforce
revision numbers to test descriptions. Replace this with the git commit hash
in the tests' descriptions.
Nicholas Clark [Fri, 25 Feb 2011 10:49:50 +0000 (10:49 +0000)]
Remove now-unnecessary C<use File::Spec> from t/op/inccode.t
This has been vestigial since
1c25d394345c1b97 converted it to using test.pl's
tempfile().
Nicholas Clark [Thu, 24 Feb 2011 16:46:49 +0000 (16:46 +0000)]
Migrate t/op/{fork,runlevel,tie}.t to use run_multiple_progs().
The addition of "OPTION random" to all fork.t's tests might be overkill, given
that run_multiple_progs() can specify "random" per test, but as the previous
code in fork.t always sorted before comparison, we are no *worse* off than we
were.
Nicholas Clark [Thu, 24 Feb 2011 16:04:45 +0000 (16:04 +0000)]
Migrate the test running logic from t/lib/common.pl to t/test/pl
This will make it available to several tests in t/op, which currently duplicate
it.
Nicholas Clark [Thu, 24 Feb 2011 14:57:14 +0000 (14:57 +0000)]
Convert t/lib/common.pl to lexical filehandles and 3-arg open.
Remove the unused lexical variable %tempfiles. It would be good to lint
everything - I suspect that there are quite a few unused lexicals stowing away
in the core tests.