This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Ricardo Signes [Sun, 21 Apr 2013 01:08:14 +0000 (21:08 -0400)]
Bump the perl version in various places for 5.17.12
...even though it should not get released
Ricardo Signes [Sun, 21 Apr 2013 00:57:26 +0000 (20:57 -0400)]
Merge branch 'release-5.17.11' into blead
Karl Williamson [Sat, 20 Apr 2013 17:39:28 +0000 (11:39 -0600)]
perlapi.pod: Clarify character classification macros
The language was confusing, and this also fixes a typo.
David Mitchell [Sat, 20 Apr 2013 16:31:19 +0000 (17:31 +0100)]
[MERGE] Handle /@a/ array expansion within regex engine
This series of commits reorganises the code that concatenates and processes
the list of args in a run-time regular expression (fixing some bugs along
the way); then, most significantly, defers flattening and concatting an
array in /...@a.../ until the regex engine: so the engine gets to process
the individual elements of @a rather than being presented with a just a
final concatenated string. This allows us to improve the handling of code
blocks and overloading of the individual array elements.
Fixes RT #115004.
David Mitchell [Wed, 17 Apr 2013 16:51:16 +0000 (17:51 +0100)]
Handle /@a/ array expansion within regex engine
Previously /a@{b}c/ would be parsed as
regcomp('a', join($", @b), 'c')
This means that the array was flattened and its contents stringified before
hitting the regex engine.
Change it so that it is parsed as
regcomp('a', @b, 'c')
(but where the array isn't flattened, but rather just the AV itself is
pushed onto the stack, c.f. push @b, ....).
This means that the regex engine itself can process any qr// objects
within the array, and correctly extract out any previously-compiled
code blocks (thus preserving the correct closure behaviour). This is
an improvement on 5.16.x behaviour, and brings it into line with the
newish 5.17.x behaviour for *scalar* vars where they happen to hold
regex objects.
It also fixes a regression from 5.16.x, which meant that you suddenly
needed a 'use re eval' in scope if any of the elements of the array were
a qr// object with code blocks (RT #115004).
It also means that 'qr' overloading is now handled within interpolated
arrays as well as scalars:
use overload 'qr' => sub { return qr/a/ };
my $o = bless [];
my @a = ($o);
"a" =~ /^$o$/; # always worked
"a" =~ /^@a$/; # now works too
David Mitchell [Thu, 18 Apr 2013 14:42:35 +0000 (15:42 +0100)]
S_pat_upgrade_to_utf8(): add num_code_blocks arg
This function was added a few commits ago in this branch. It's intended
to upgrade a pattern string to utf8, while simultaneously adjusting the
start/end byte indices of any code blocks. In two of the three places
it is called from, all code blocks will already have been processed,
so the number of code blocks equals pRExC_state->num_code_blocks.
In the third place however (S_concat_pat), not all code blocks have yet
been processed, so using num_code_blocks causes us to fall off the end of
the index array.
Add an extra arg to S_pat_upgrade_to_utf8() to tell it how many code
blocks exist so far.
David Mitchell [Tue, 16 Apr 2013 11:36:04 +0000 (12:36 +0100)]
Perl_re_op_compile() re-indent code
Re-indent code after the previous commit removed a block scope.
Only whitespace changes.
David Mitchell [Tue, 16 Apr 2013 11:12:21 +0000 (12:12 +0100)]
re_op_compile: eliminate a local var and scope
Eliminate a local var and the block scope it is declared in
(There should be no functional changes).
Re-indenting will be in the next commit.
David Mitchell [Tue, 16 Apr 2013 10:34:54 +0000 (11:34 +0100)]
combine regex concat overload loops
Currently when the components of a runtime regex (e.g. the "a", $x, "-"
in /a$x-/) are concatenated into a single pattern string, the handling of
magic and various types of overloading is done within two separate loops:
(in perlish pseudocode):
foreach (@arg) {
SvGETMAGIC($_);
apply 'qr' overloading to $_;
}
foreach (@arg) {
$pat .= $_, allowing for '.' and '""' overloading;
}
This commit changes it to:
foreach (@arg) {
SvGETMAGIC($_);
apply 'qr' overloading to $_;
$pat .= $_, allowing for '.' and '""' overloading;
}
Note that this is in theory a user-visible change in behaviour, since
the order in which various perl-level tie and overload functions get
called may change. But that was just a quirk of the current
implementation, rather than a documented feature.
David Mitchell [Tue, 16 Apr 2013 09:57:10 +0000 (10:57 +0100)]
Perl_re_op_compile(): extract conatting code
Extract out the big chunk of code that concatenates the components
of a pattern string, into the new static function S_concat_pat().
As well as being tidier, it will shortly allow us to recursively
concatenate, and allow us to directly interpolate arrays such as
/@foo/, rather than relying on pp_join to do it for us.
David Mitchell [Mon, 15 Apr 2013 16:18:30 +0000 (17:18 +0100)]
Perl_re_op_compile(): handle utf8 concating better
When concatting the list of arguments together to form a final pattern
string, the code formerly did a quick scan of all the args first, and
if any of them were SvUTF8, it set the (empty) destination string to UTF8
before concatting all the individual args. This avoided the pattern
getting upgraded to utf8 halfway through, and thus the indices for code
blocks becoming invalid.
However this was not 100% reliable because, as an "XXX" code comment of
mine pointed out, when overloading is involved it is possible for an arg
to appear initially not to be utf8, but to be utf8 when its value is
finally accessed. This results an obscure bug (as shown in the test added
for this commit), where literal /(?{code})/ still required 'use re
"eval"'.
The fix for this is to instead adjust the code block indices on the fly
if the pattern string happens to get upgraded to utf8. This is easy(er)
now that we have the new S_pat_upgrade_to_utf8() function.
As well as fixing the bug, this also simplifies the main concat loop in
the code, which will make it easier to handle interpolating arrays (e.g.
/@foo/) when we move the interpolation from the join op into the regex
engine itself shortly.
David Mitchell [Mon, 15 Apr 2013 13:41:10 +0000 (14:41 +0100)]
Perl_re_op_compile: eliminate clunky if (0) {}
There was a bit of code that did
if (0) {
redo_first_pass:
...foo...;
}
to allow us to jump back and repeat the first pass, doing some extra stuff
the second time round. Since foo has now been abstracted into a separate
function, we can instead call it each time directly before jumping,
allowing us to remove the ugly if (0).
David Mitchell [Mon, 15 Apr 2013 13:35:23 +0000 (14:35 +0100)]
Perl_re_op_compile(): eliminate xend var
it's value is easily (re)calculated, and we no longer have to worry
about making sure we update it everywhere.
David Mitchell [Mon, 15 Apr 2013 13:20:40 +0000 (14:20 +0100)]
Perl_re_op_compile(): add S_pat_upgrade_to_utf8()
Extract out the code that upgrades the pattern string to utf8 (and adjusts
any code-block indices) into a separate function, S_pat_upgrade_to_utf8().
As well as being tidier, we'll be calling the code from other places
shortly.
Ricardo Signes [Sat, 20 Apr 2013 02:01:38 +0000 (22:01 -0400)]
perldelta: ExtUtils::MakeMaker update
Ricardo Signes [Sat, 20 Apr 2013 01:40:16 +0000 (21:40 -0400)]
update Module::CoreList for v5.17.11
Ricardo Signes [Sat, 20 Apr 2013 01:34:28 +0000 (21:34 -0400)]
perldelta: module updates for 5.17.11
Ricardo Signes [Sat, 20 Apr 2013 01:24:02 +0000 (21:24 -0400)]
acknowledgements in perldelta
Karl Williamson [Fri, 19 Apr 2013 23:15:30 +0000 (17:15 -0600)]
perldiag.pod: Fix wrong Perl versions
It was planned to make certain changes in 5.18, but this didn't happen.
Change the expected version to 5.20, and add some detail.
Chris 'BinGOs' Williams [Fri, 19 Apr 2013 19:55:57 +0000 (20:55 +0100)]
Update ExtUtils-MakeMaker to CPAN version 6.66
[DELTA]
6.66 Fri Apr 19 17:53:13 BST 2013
No changes from 6.65_03
6.65_03 Mon Apr 15 13:44:24 BST 2013
Test Fixes
* Use File::Temp in parse_* tests to resolve race conditions
on 64bit Windows
(bingos)
6.65_02 Sun Apr 14 10:56:41 BST 2013
Test Fixes
* t/xs.t is now running tests against the XS build.
(Michael G Schwern) (Leon Timmermans)
6.65_01 Tue Mar 19 00:06:17 CET 2013
New Features
* Improvements perlcritic support. (M. Schwern)
* Improvements to dynamic linking for gcc (Tobias Leich)
[github #43]
* Change $(PERL_HDRS) from a hard coded list of headers to
reading install directory for available header files. Allows
us to work with any version of Perl properly.
(Yves Orton, Craig A. Berry) [github #47]
Doc Fixes
* Numerous typo fixes. (Ben Bullock)
[github #33] [github #34] [github #35]
* Various FAQ and doc improvements (M. Schwern, Ivan Bessarabov)
[github #44]
Bug Fixes
* fixes relating to hash ordering (Yves Orton)
[github #46] [rt.cpan.org #83441] [rt.perl.org #116857]
* fixes to Mksymlists (Ben Bullock, Yves Orton)
[github #48] [github #49] [github #51]
Ricardo Signes [Fri, 19 Apr 2013 19:04:19 +0000 (15:04 -0400)]
perldelta: significant typo!
Ricardo Signes [Fri, 19 Apr 2013 15:17:00 +0000 (11:17 -0400)]
perldelta: update most of the delta for 5.17.11
David Mitchell [Fri, 19 Apr 2013 14:17:02 +0000 (15:17 +0100)]
\N was still marked experimental in some places
Tony Cook [Fri, 19 Apr 2013 00:02:33 +0000 (10:02 +1000)]
Francois Perrad [Mon, 15 Apr 2013 11:37:35 +0000 (13:37 +0200)]
fix dist/IO/t/cachepropagate-unix.t
same fix as in the last commit in cachepropagate-udp.t
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Tony Cook [Mon, 15 Apr 2013 23:29:19 +0000 (09:29 +1000)]
remove excluded test file cpan/ExtUtils-MakeMaker/t/Liblist_Kid.t
https://rt.perl.org/rt3/Ticket/Display.html?id=117477
David Mitchell [Mon, 15 Apr 2013 12:40:31 +0000 (13:40 +0100)]
fix comment typo in regcomp.c
Leon Timmermans [Sun, 14 Apr 2013 07:59:33 +0000 (09:59 +0200)]
Converted Asian documentations to utf-8
Transcoded README.{cn,jp,ko} to utf-8
Fixed encoding lines for README.{cn,jp,ko,tw}
Fixed verbatim text for README.{cn,ko}
Moritz Lenz [Thu, 11 Apr 2013 13:17:04 +0000 (15:17 +0200)]
Document that range operator '..' can not be overloaded.
Also document that this means that ranges and bigint.pm do not mix perfectly.
Bump version numbers.
James E Keenan [Sat, 2 Mar 2013 18:52:27 +0000 (13:52 -0500)]
Provide file and subroutine-level documentation in POD format.
Incorporate Nicholas Clark's suggestions.
Correct pod formatting errors.
For: RT #117003
James E Keenan [Sat, 13 Apr 2013 16:45:10 +0000 (17:45 +0100)]
Subject: [PATCH] Update INSTALLDIRS to favor installation under 'site'.
For: RT #116479
Chris 'BinGOs' Williams [Sat, 13 Apr 2013 23:34:44 +0000 (00:34 +0100)]
Update CPAN to CPAN version 2.00
[DELTA]
2013-04-12 Andreas Koenig <k@UX31A>
* release 2.00 (at Lancester #QA2013)
* Removed the trial status for the release in the Makefile.PL
* Merge with App::Cpan 0.61 (just a version number change)
James E Keenan [Fri, 22 Mar 2013 01:40:34 +0000 (21:40 -0400)]
Porting/curliff.pl no longer needed; delete it.
Documentation patch submitted by Brad Gilbert++ provoked discussion concerning
whether this program is still needed. Consensus was that it is not.
For: RT #117185
Aaron Crane [Fri, 22 Feb 2013 16:18:33 +0000 (16:18 +0000)]
B::Deparse: document that `state sub` is unimplemented
Aaron Crane [Fri, 12 Apr 2013 15:08:40 +0000 (16:08 +0100)]
deparse.t: delete now-unneeded __WARN__ suppression
B::Deparse no longer emits the warnings in question.
Aaron Crane [Fri, 22 Feb 2013 16:15:46 +0000 (16:15 +0000)]
B::Deparse: stub implementation of deparsing lexical subs
This doesn't work properly, but (a) it's better than nothing, and (b) it
suppresses some unsightly "unexpected OP_INTROCV" warnings from the test
suite, fixing RT #116821.
David Mitchell [Fri, 12 Apr 2013 10:30:25 +0000 (11:30 +0100)]
[MERGE] handle /(?{})/ with overload::constant qr
The reworking of the re_eval implementation for 5.17.1 made the assumption
that constant strings within literal patterns were, um, constant.
It turns out this this is an invalid assumption, because
overload::constant qr => { sub return bless [], 'Foo' }
can cause the constant bits of a pattern, like foo, bar in
/foo(?{...})bar/
to get replaced with (for example) blessed objects: so the 'constant' SV
attached to an OP_CONST is actually a blessed object, that could itself be
overloaded with string or concat methods say, or could be a qr// object
etc.
The commits in this merge (hopefully) fix the various problems this
assumption caused: chiefly with qr// objects containing compiled (?{})
code that were getting re-stringified and thus failing unless in the
presence of use re 'eval' (and sometimes failing even in its presence).
Also, runtime patterns could trigger a recursive call to the overload
method, and eventually stack overflow and SEGV.
See [perl #116823].
David Mitchell [Wed, 10 Apr 2013 15:10:28 +0000 (16:10 +0100)]
fix runtime /(?{})/ with overload::constant qr
There are two issues fixed here.
First, when a pattern has a run-time code-block included, such as
$code = '(?{...})'
/foo$code/
the mechanism used to parse those run-time blocks: of feeding the
resultant pattern into a call to eval_sv() with the string
qr'foo(?{...})'
and then extracting out any resulting opcode trees from the returned
qr object -- suffered from the re-parsed qr'..' also being subject to
overload:constant qr processing, which could result in Bad Things
happening.
Since we now have the PL_parser->lex_re_reparsing flag in scope throughout
the parsing of the pattern, this is easy to detect and avoid.
The second issue is a mechanism to avoid recursion when getting false
positives in S_has_runtime_code() for code like '[(?{})]'.
For patterns like this, we would suspect that the pattern may have code
(even though it doesn't), so feed it into qr'...' and reparse, and
again it looks like runtime code, so feed it in, rinse and repeat.
The thing to stop recursion was when we saw a qr with a single OP_CONST
string, we assumed it couldn't have any run-time component, and thus no
run-time code blocks.
However, this broke qr/foo/ in the presence of overload::constant qr
overloading, which could convert foo into a string containing code blocks.
The fix for this is to change the recursion-avoidance mechanism (in a way
which also turns out to be simpler too). Basically, when we fake up a
qr'...' and eval it, we turn off any 'use re eval' in scope: its not
needed, since we know the .... will be a constant string without any
overloading. Then we use the lack of 'use re eval' in scope to
skip calling S_has_runtime_code() and just assume that the code has no
run-time patterns (if it has, then eventually the regex parser will
rightly complain about 'Eval-group not allowed at runtime').
This commit also adds some fairly comprehensive tests for this.
David Mitchell [Tue, 9 Apr 2013 16:17:16 +0000 (17:17 +0100)]
add lex_re_reparsing boolean to yy_parser struct
When re-parsing a pattern for run-time (?{}) code blocks,
we end up with the EVAL_RE_REPARSING flag set in PL_in_eval.
Currently we clear this flag as soon as scan_str() returns, to ensure that
it's not set if we happen to parse further patterns (e.g. within the
(?{ ... }) code itself.
However, a soon-to-be-applied bugfix requires us to know the reparsing
state beyond this point. To solve this, we add a new boolean flag to the
parser struct, which is set from PL_in_eval in S_sublex_push() (with the
old value being saved). This allows us to have the flag around for the
entire pattern string parsing phase, without it affecting nested pattern
compilation.
David Mitchell [Thu, 4 Apr 2013 16:50:22 +0000 (17:50 +0100)]
Eliminate PL_reg_state.re_reparsing, part 2
The previous commit added an alternative flag mechanism to
PL_reg_state.re_reparsing, but kept the old one around for consistency
checking. Remove the old one now.
David Mitchell [Thu, 4 Apr 2013 16:29:53 +0000 (17:29 +0100)]
Eliminate PL_reg_state.re_reparsing, part 1
PL_reg_state.re_reparsing is a hacky flag used to allow runtime
code blocks to be included in patterns. Basically, since code blocks
are now handled by the perl parser within literal patterns, runtime
patterns are handled by taking the (assembled at runtime) pattern,
and feeding it back through the parser via the equivalent of
eval q{qr'the_pattern'},
so that run-time (?{..})'s appear to be literal code blocks.
When this happens, the global flag PL_reg_state.re_reparsing is set,
which modifies lexing and parsing in minor ways (such as whether \\ is
stripped).
Now, I'm in the slow process of trying to eliminate global regex state
(i.e. gradually removing the fields of PL_reg_state), and also a change
which will be coming a few commits ahead requires the info which this flag
indicates to linger for longer (currently it is cleared immediately after
the call to scan_str().
For those two reasons, this commit adds a new mechanism to indicate this:
a new flag to eval_sv(), G_RE_REPARSING (which sets OPpEVAL_RE_REPARSING
in the entereval op), which sets the EVAL_RE_REPARSING bit in PL_in_eval.
Its still a yukky global flag hack, but its a *different* global flag hack
now.
For this commit, we add the new flag(s) but keep the old
PL_reg_state.re_reparsing flag and assert that the two mechanisms always
match. The next commit will remove re_reparsing.
David Mitchell [Thu, 28 Mar 2013 15:29:14 +0000 (15:29 +0000)]
re_op_compile(): reapply debugging statements
These were temporarily removed a few commits ago to make rebasing easier.
(And since the code's been simplified in the conflicting branch, not so
many debug statements had to be added back as were in the original).
David Mitchell [Thu, 28 Mar 2013 14:11:16 +0000 (14:11 +0000)]
Handle overloading properly in compile-time regex
[perl #116823]
In re_op_compile(), there were two different code paths for compile-time
patterns (/foo(?{1})bar/) and runtime (/$foo(?{1})bar/).
The code in question is where the various components of the pattern
are concatenated into a single string, for example, 'foo', '(?{1})' and
'bar' in the first pattern.
In the run-time branch, the code assumes that each component (e.g. the
value of $foo) can be absolutely anything, and full magic and overload
handling is applied as each component is retrieved and appended to the
pattern string.
The compile-time branch on the other hand, was a lot simpler because it
"knew" that each component is just a simple constant SV attached to an
OP_CONST op. This turned out to be an incorrect assumption, due to
overload::constant qr overloading; here, a simple constant part of a
compile-time pattern, such as 'foo', can be converted into whatever the
overload function returns; in particular, an object blessed into an
overloaded class. So the "simple" SVs that get attached to OP_CONST ops
can in fact be complex and need full magic, overloading etc applied to
them.
The quickest solution to this turned out to be, for the compile-time case,
extract out the SV from each OP_CONST and assemble them into a temporary
SV** array; then from then onwards, treat it the same as the run-time case
(which expects an array of SVs).
David Mitchell [Thu, 28 Mar 2013 13:08:42 +0000 (13:08 +0000)]
re-indent after last change
(only whitespace changes)
David Mitchell [Thu, 28 Mar 2013 12:07:18 +0000 (12:07 +0000)]
re_op_compile(): unify 1-op and N-op branches
When assembling a compile-time pattern from a list of OP_CONSTs (and
possibly embedded code-blocks), there were separate code paths for a
single arg (a lone OP_CONST) and a list of OP_CONST / DO's.
Unify the branches into single loop.
This will make a subsequent commit easier, where we will need to do more
processing of each "constant".
Re-indenting has been left to the commit that follows this.
David Mitchell [Mon, 25 Mar 2013 17:23:12 +0000 (17:23 +0000)]
re_op_compile(): simplify a code snippet
and eliminate one local var.
David Mitchell [Mon, 25 Mar 2013 17:19:23 +0000 (17:19 +0000)]
re-indent code after previous commit
(whitespace changes only)
David Mitchell [Mon, 25 Mar 2013 17:06:47 +0000 (17:06 +0000)]
regex and overload: unifiy 1 and N arg branches
When compiling a regex, something like /a$b/ that parses two two args,
was treated in a different code path than /$a/ say, which is only one arg.
In particular the 1-arg code path, where it handled "" overloading, didn't
check for a loop (where the ""-sub returns the overloaded object itself) -
the N-arg branch did handle that. By unififying the branches, we get that
fix for free, and ensure that any future fixes don't have to be applied to
two separate branches.
Re-indented has been left to the commit that follows this.
David Mitchell [Thu, 28 Mar 2013 15:08:27 +0000 (15:08 +0000)]
re_op_compile(): temp remove some debugging code
These four DEBUG_PARSE_r()'s were recently added to a block I code
which I have just been extensively reworking in a separate branch.
Temporarily remove these statements to allow my branch to be rebased;
I'll re-add them (or similar) afterwards.
Aaron Crane [Thu, 11 Apr 2013 15:28:39 +0000 (16:28 +0100)]
pod/perlsec.pod: fix typo and tweak wording
Craig A. Berry [Thu, 11 Apr 2013 03:25:35 +0000 (22:25 -0500)]
Fix post-install instructions in README.vms.
perl_setup.com gets installed, so we might as well run it from
where we have it rather than copying it somewhere.
And we really shouldn't be recommending putting things in sys$share,
even as a second choice.
James E Keenan [Wed, 10 Apr 2013 10:54:02 +0000 (11:54 +0100)]
Provide proper link to original Dylan paper.
Patch submitted by Dmitry Karasik++. For: RT #117519
Craig A. Berry [Sat, 6 Apr 2013 15:45:04 +0000 (10:45 -0500)]
Directory rename no longer needed on VMS.
As of 5.18.0, Perl on VMS can (at last) be built in and installed
from a directory having dots in the name, so it is no longer
necessary to rename the top-level source directory before building.
The pertinent instructions have been removed from README.vms, so
we also no longer need to update the version number that was
embedded in those instructions.
Craig A. Berry [Sat, 6 Apr 2013 03:14:16 +0000 (22:14 -0500)]
Assorted updates to README.vms
Karl Williamson [Fri, 5 Apr 2013 18:37:56 +0000 (12:37 -0600)]
perlop.pod: Fix typo that yields wrong info
Jan Dubois [Thu, 4 Apr 2013 21:12:04 +0000 (14:12 -0700)]
S_* functions should be STATIC
Karl Williamson [Fri, 29 Mar 2013 18:29:46 +0000 (12:29 -0600)]
handy.h: Remove docs for non-existent macro
In commit
3c3ecf18c35ad7832c6e454d304b30b2c0fef127, I mistakenly added
documentation for a non-existent macro. It turns out that only the
variants listed for that macro exist, and not the base macro. Since we
are in code freeze, the solution has to be not to change code by adding
the base macro, but to delete the documentation, or change it to refer
to just the existing versions. In order to not cause an entry that is
anomalous to the others, for this release, I'm just getting rid of the
documentation.
Yves Orton [Fri, 29 Mar 2013 11:27:46 +0000 (12:27 +0100)]
improve hash related documentation in perlfunc and perlsec to reflect new hash randomization logic
Yves Orton [Fri, 29 Mar 2013 11:03:08 +0000 (12:03 +0100)]
Fix perlfunc.pod to reflect changes to split " " logic
Andy Dougherty [Wed, 27 Mar 2013 19:54:05 +0000 (15:54 -0400)]
Remove the non-inline function S_croak_memory_wrap from inline.h.
This appears to resolve these three related tickets:
[perl #116989] S_croak_memory_wrap breaks gcc warning flags detection
[perl #117319] Can't include perl.h without linking to libperl
[perl #117331] Time::HiRes::clock_gettime not implemented on Linux (regression?)
This patch changes S_croak_memory_wrap from a static (but not inline)
function into an ordinary exported function Perl_croak_memory_wrap.
This has the advantage of allowing programs (particuarly probes, such
as in cflags.SH and Time::HiRes) to include perl.h without linking
against libperl. Since it is not a static function defined within each
compilation unit, the optimizer can no longer remove it when it's not
needed or inline it as needed. This likely negates some of the savings
that motivated the original commit
380f764c1ead36fe3602184804292711.
However, calling the simpler function Perl_croak_memory_wrap() still
does take less set-up than the previous version, so it may still be a
slight win. Specific cross-platform measurements are welcome.
Andy Dougherty [Thu, 28 Mar 2013 00:11:34 +0000 (20:11 -0400)]
makedef.pl shouldn't prepend Perl_ to symbols already starting with Perl_.
In the next patch, I have Perl_croak_memory_wrap defined in embed.fnc with
the 'nroX' flags, since this is a private function used by public macros.
I used the long form of the name Perl_croak_memory_wrap everywhere, and
used the 'o' flag so that embed.h wouldn't contain a useless #define
croak_memory_wrap Perl_croak_memory_wrap. Unfortunately, makedef.pl
(used by the Win32 build process) didn't know what to do with that entry
and created an entry Perl_Perl_croak_memory_wrap. Changing makedef.pl
to use the 'o' flag to decide whether to add the Perl_ prefix resulted
in over 50 other symbols changing in the output of makedef.pl. I don't
know if the changes are correct or if the 'o' flag is in error on those
entries in embed.fnc, but I don't have time to check them all out.
This patch just stops makedef.pl from adding a Perl_ prefix if there is
already one there.
Chris 'BinGOs' Williams [Wed, 27 Mar 2013 16:53:12 +0000 (16:53 +0000)]
Exporter on CPAN is 5.68 make blead reflect this
Yves Orton [Wed, 27 Mar 2013 12:20:08 +0000 (13:20 +0100)]
eliminate the only internal uses of HvFILL
The usages are as far as I know incorrect anyway. We resize
the hash bucket array based on the number of keys it holds,
not based on the number of buckets that are used, so this
usage was wrong anyway.
Another bug that this revealed is that the old code would allow
HvMAX(hv) to fall to 0, even though every other part of the
core expects it to have a minimum of 7 (meaning 8 buckets).
As part of this we change the hard coded 7 to a defined constant
PERL_HASH_DEFAULT_HvMAX.
After this patch there remains one use of HvFILL in core, that used
for scalar(%hash) which I plan to remove in a later patch.
Yves Orton [Wed, 27 Mar 2013 10:17:25 +0000 (11:17 +0100)]
prevent SEGV from buffer read overrun, and refactor away duplicated code
The split patch introduced a buffer read overrun error in sv_dump() when
stringifying empty strings. This bug was always existant but was probably
never triggered because we almost always have at least one extflags set,
so it never got an empty buffer to show. Not so with the new compflags. :-(
Yves Orton [Mon, 25 Mar 2013 22:15:00 +0000 (23:15 +0100)]
fix comment, reindent and add parenthesis for clarity
I had to stare at this expression and make sure there wasn't
anything tricky for too long, so I added parens, and reindented
it.
Yves Orton [Mon, 25 Mar 2013 22:23:40 +0000 (23:23 +0100)]
rework split() special case interaction with regex engine
This patch resolves several issues at once. The parts are
sufficiently interconnected that it is hard to break it down
into smaller commits. The tickets open for these issues are:
RT #94490 - split and constant folding
RT #116086 - split "\x20" doesn't work as documented
It additionally corrects some issues with cached regexes that
were exposed by the split changes (and applied to them).
It effectively reverts
5255171e6cd0accee6f76ea2980e32b3b5b8e171
and
cccd1425414e6518c1fc8b7bcaccfb119320c513.
Prior to this patch the special RXf_SKIPWHITE behavior of
split(" ", $thing)
was only available if Perl could resolve the first argument to
split at compile time, meaning under various arcane situations.
This manifested as oddities like
my $delim = $cond ? " " : qr/\s+/;
split $delim, $string;
and
split $cond ? " ", qr/\s+/, $string
not behaving the same as:
($cond ? split(" ", $string) : split(/\s+/, $string))
which isn't very convenient.
This patch changes this by adding a new flag to the op_pmflags,
PMf_SPLIT which enables pp_regcomp() to know whether it was called
as part of split, which allows the RXf_SPLIT to be passed into run
time regex compilation. We also preserve the original flags so
pattern caching works properly, by adding a new property to the
regexp structure, "compflags", and related macros for accessing it.
We preserve the original flags passed into the compilation process,
so we can compare when we are trying to decide if we need to
recompile.
Note that this essentially the opposite fix from the one applied
originally to fix #94490 in
5255171e6cd0accee6f76ea2980e32b3b5b8e171.
The reverted patch was meant to make:
split( 0 || " ", $thing ) #1
consistent with
my $x=0; split( $x || " ", $thing ) #2
and not with
split( " ", $thing ) #3
This was reverted because it broke C<split("\x{20}", $thing)>, and
because one might argue that is not that #1 does the wrong thing,
but rather that the behavior of #2 that is wrong. In other words
we might expect that all three should behave the same as #3, and
that instead of "fixing" the behavior of #1 to be like #2, we should
really fix the behavior of #2 to behave like #3. (Which is what we did.)
Also, it doesn't make sense to move the special case detection logic
further from the regex engine. We really want the regex engine to decide
this stuff itself, otherwise split " ", ... wouldn't work properly with
an alternate engine. (Imagine we add a special regexp meta pattern that behaves
the same as " " does in a split /.../. For instance we might make
split /(*SPLITWHITE)/ trigger the same behavior as split " ".
The other major change as result of this patch is it effectively
reverts commit
cccd1425414e6518c1fc8b7bcaccfb119320c513, which
was intended to get rid of RXf_SPLIT and RXf_SKIPWHITE, which
and free up bits in the regex flags structure.
But we dont want to get rid of these vars, and it turns out that
RXf_SEEN_LOOKBEHIND is used only in the same situation as the new
RXf_MODIFIES_VARS. So I have renamed RXf_SEEN_LOOKBEHIND to
RXf_NO_INPLACE_SUBST, and then instead of using two vars we use
only the one. Which in turn allows RXf_SPLIT and RXf_SKIPWHITE to
have their bits back.
Yves Orton [Mon, 25 Mar 2013 22:06:22 +0000 (23:06 +0100)]
simplify regcomp.c by using vars to avoid repeated macros
Use two temporary variables to simplify the logic, and maybe
speed up a nanosecond or two.
Also chainsaw some long dead logic. (I #ifdef'ed it out years ago)
Yves Orton [Mon, 25 Mar 2013 19:08:56 +0000 (20:08 +0100)]
Improve how regcomp.pl handles multibits
In preparation for future changes.
Brian Fraser [Mon, 25 Mar 2013 04:46:43 +0000 (01:46 -0300)]
Silence "smartmatch is experimental" warnings in autodie
Brian Fraser [Tue, 26 Mar 2013 00:17:51 +0000 (21:17 -0300)]
perldelta for the new warnings
Brian Fraser [Mon, 25 Mar 2013 04:22:35 +0000 (01:22 -0300)]
Make smartmatch, given & when experimental
Brian Fraser [Mon, 25 Mar 2013 05:10:08 +0000 (02:10 -0300)]
t/porting/dual-life.t: Drop dependency on smartmatch
Brian Fraser [Sat, 23 Mar 2013 20:45:10 +0000 (17:45 -0300)]
t/re/regexp_unicode_prop.t: Drop dependency on given/when
Brian Fraser [Sat, 23 Mar 2013 20:42:34 +0000 (17:42 -0300)]
Porting/core-cpan-diff: Drop dependency on smartmatch
Brian Fraser [Sat, 23 Mar 2013 20:42:00 +0000 (17:42 -0300)]
Porting/checkpodencoding.pl: Drop dependency on smartmatch
Brian Fraser [Sat, 23 Mar 2013 20:40:54 +0000 (17:40 -0300)]
File::Glob: Drop dependency on given/when
Karl Williamson [Tue, 26 Mar 2013 19:30:02 +0000 (13:30 -0600)]
perlapi: Document some macros
Nicholas Clark [Mon, 25 Mar 2013 12:06:09 +0000 (13:06 +0100)]
xs_init() must pass a static char* when creating &DynaLoader::boot_DynaLoader.
newXS() assumes that the passed pointer to the filename is in static storage,
or otherwise will outlive the PVCV that it is about to create, and hence that
it's safe to copy the pointer, not the value, to CvFILE. Hence xs_init()
must not use an auto array to "store" the filename, as that will be on the
stack, and becomes invalid as soon as xs_init() returns. The analogous bug
fix was made in universal.c by commit
157e3fc8c802010d in Feb 2006.
Spotted by compiling for ithreads with gcc 4.8.0's ASAN and running
dist/B-Deparse/t/deparse.t
Nicholas Clark [Mon, 25 Mar 2013 10:56:40 +0000 (11:56 +0100)]
In In S_scan_heredoc(), avoid memNE() reading beyond the end of s.
If the heredoc terminator we are searching for is longer than the bytes
remaining in s, then the memNE() would read beyond initialised memory.
Hence change the loop bounds to avoid this case, and change the failure case
below to reflect the revised end-of-loop condition.
It doesn't matter that the loop no longer increments shared->herelines,
because the failure case calls S_missingterm(), which croaks.
Nicholas Clark [Mon, 25 Mar 2013 09:53:33 +0000 (10:53 +0100)]
In S_scan_heredoc(), the explicit test for '\n' duplicates the strNE().
PL_tokenbuf always starts with '\n', so a separate test of *s against '\n'
is duplicate work. Hence remove it, to make the code simpler and clearer.
Nicholas Clark [Mon, 25 Mar 2013 09:20:05 +0000 (10:20 +0100)]
PerlIO_find_layer should not be using memEQ() off the end of the layer name.
PerlIO_find_layer was using memEQ() to compare the name of the desired layer
with each layer in the array of known layers. However, it was always using
the length of the desired layer for the comparison, whatever the length of
the name it was comparing it with, resulting in out-of-bounds reads.
Craig A. Berry [Mon, 25 Mar 2013 01:49:38 +0000 (20:49 -0500)]
Copyright update for vms/vms.c.
Happy 20th Anniversary, Charles.
Craig A. Berry [Mon, 25 Mar 2013 01:39:38 +0000 (20:39 -0500)]
Make vms.c's Perl_flex_fstat preserve errno on success.
The CRTL's fstat() sets errno to EVMSERR and vaxc$errno to RMS$_IOP
when called on a proccess-permanent file (i.e., stdin, stdout, or
stderr). That error generally means a rewind operation on a file
that cannot be rewound. It's odd that fstat is doing such a thing,
but we can at least protect ourselves from the effects of it by
saving errno and restoring it on a successful call.
This cures a couple of test failures and TODOs in t/io/errno.t.
Craig A. Berry [Mon, 25 Mar 2013 01:31:59 +0000 (20:31 -0500)]
Revert "Restore errno after VMS hack in S_sv_gets_read_record."
This reverts commit
d46f021e36854e800770363f716e7b4a846102ef.
This can be done more universally (and from the point of view of
sv.c, less obtrusively) in Perl_flex_fstat in vms/vms.c.
Yves Orton [Sun, 24 Mar 2013 10:48:12 +0000 (11:48 +0100)]
improve how Devel::Peek::Dump handles iterator information
* If the hash is not OOK omit any iterator status information
instead of showing -1/NULL
* If the hash is OOK then add the RAND value from the iterator
and if the LASTRAND is not the same show it too
* Tweak tests to test the above.
Yves Orton [Sun, 24 Mar 2013 10:47:22 +0000 (11:47 +0100)]
Add a commented out warning and a way for diag.t to ignore it
Yves Orton [Sun, 24 Mar 2013 10:46:22 +0000 (11:46 +0100)]
improve iterator randomization
Max Maischein [Sun, 24 Mar 2013 10:35:43 +0000 (11:35 +0100)]
Add epigraph for 5.17.10
David Mitchell [Sat, 23 Mar 2013 23:08:59 +0000 (23:08 +0000)]
fix Peek.t to work with NEW COW
David Mitchell [Sat, 23 Mar 2013 23:05:18 +0000 (23:05 +0000)]
Revert "fix Peek.t to work with NEW COW"
This reverts commit
2b656fcc48f28912136698c28b3bd916c42d74f8.
I accidentally included the changes I was reviewing from a patch of
Reini's
David Mitchell [Sat, 23 Mar 2013 21:29:26 +0000 (21:29 +0000)]
regcomp.c: silence compiler warning
add a cast before doing a printf "%x" on a pointer
David Mitchell [Sat, 23 Mar 2013 21:17:01 +0000 (21:17 +0000)]
add descriptions to require.t test output
This is particularly important as in several places, the ok or not ok
message is generated in different ways depending on whether a require
successfully executed and printed "ok" for example.
David Mitchell [Sat, 23 Mar 2013 20:32:00 +0000 (20:32 +0000)]
fix Peek.t to work with NEW COW
Ricardo Signes [Sat, 23 Mar 2013 20:34:03 +0000 (16:34 -0400)]
fix a missed s/deprecated/experimental/ for my $_
Craig A. Berry [Sat, 23 Mar 2013 01:39:37 +0000 (20:39 -0500)]
Restore errno after VMS hack in S_sv_gets_read_record.
In
596a6cbd6bcaa8e6a4 I added a somewhat desperate hack to detect
if a file is record-oriented so that we preserve record semantics
when PL_rs has beeen set. I did it by calling fstat(), which is
already a pretty icky thing to be doing on every record read, but
it turns out things are even worse becaseu fstat() sets errno in
some conditions where it's successful, specifically when the file
is a Process-Permanent File (PPF), i.e., standard input or output.
So save errno before the fstat and restore it before doing the
read so if the read fails we get a proper errno. This gets
t/io/errno.t passing.
Side note: instead of fstat() here, we probably need to store a
pointer to the FAB (File Access Block) in the PerlIO struct so all
the metadata about the file is always accessible. This would
require setting up completion routines in PerlIOUnix_open and
PerlIOStdio_open.
Chris 'BinGOs' Williams [Fri, 22 Mar 2013 13:01:16 +0000 (13:01 +0000)]
constant is 1.27 on CPAN
Chris 'BinGOs' Williams [Fri, 22 Mar 2013 13:00:07 +0000 (13:00 +0000)]
Module-CoreList is 2.85 on CPAN
Max Maischein [Fri, 22 Mar 2013 09:42:10 +0000 (10:42 +0100)]
Bump version to5.17.11
Max Maischein [Fri, 22 Mar 2013 08:18:58 +0000 (09:18 +0100)]
New perldelta
Max Maischein [Fri, 22 Mar 2013 07:53:18 +0000 (08:53 +0100)]
Merge branch 'release-5.17.10' into blead