David Mitchell [Fri, 28 Feb 2014 14:37:13 +0000 (14:37 +0000)]
copy xhv_rand and xhv_last_rand in threads clone
valgrind complains about these fields being uninitialised when cloned into a
new thread, because they aren't copied. It's fairly harmless, since these
fields are just used to perturb hash key iteration; but for completeness,
clone these fields too.
David Mitchell [Sun, 23 Feb 2014 13:25:05 +0000 (13:25 +0000)]
[perl #121230] fix kill -SIG on win32
v5.17.1-137-gc2fd40c tidied up perl's kill() implementation, making
-SIGNAME be handled correctly, It also eliminated the use of the killpg()
system/library call, which these days is usually just a thin wrapper over
kill(). By doing this, it assumed that the following are functionally
equivalent:
killpg(pgrp, sig)
kill(-pgrp, sig).
Unfortunately this broke Window's use of the (perl-level)
kill negative_value, pid, ...
since under Windows, the killpg()/kill() identity doesn't hold
(win32_kill() uses negative ids for fake-PIds, not process groups).
Fix this by restoring the use of killpg() where available.
David Mitchell [Sat, 15 Feb 2014 22:47:16 +0000 (22:47 +0000)]
speed up (non)overloaded derefs
Consider a class that has some minimal overloading added - e.g. to give
pretty stringification of objects - but which *doesn't* overload
dereference methods such as '@[]'. '%[]' etc.
In this case, simple dereferencing, such as $obj->[0] or $obj->{foo}
becomes much slower than if the object was blessed into a non-overloaded
class.
This is because every time a dereferencing is performed in pp_rv2av for
example, the "normal" code path has to go through the full checking of:
* is the stash into which the referent is blessed overloaded? If so,
* retrieve the overload magic from the stash;
* check whether the overload method cache has been invalidated and if so
rebuild it;
* check whether we are in the scope of 'no overloading', and if so
is the current method disabled in this scope?
* Is there a '@{}' or whatever (or 'nomethod') method in the cache?
If not, then process the ref as normal.
That's a lot of extra overhead to decide that an overloaded method doesn't
in fact need to be called.
This commit adds a new flag to the newish xhv_aux_flags field,
HvAUXf_NO_DEREF, which signals that the overloading of this stash
contains no deref (nor 'nomethod') overloaded methods. Thus a quick check
for this flag in the common case allows us to short-circuit all the above
checks except the first one.
Before this commit, a simple $obj->[0] was about 40-50% slower if the
class it was blessed into was overloaded (but didn't have deref methods);
after the commit, the slowdown is 0-10%. (These timings are very
approximate, given the vagaries of nano benchmarks.)
David Mitchell [Sat, 15 Feb 2014 16:46:40 +0000 (16:46 +0000)]
Document what the gv_check() function does
David Mitchell [Sat, 15 Feb 2014 16:38:31 +0000 (16:38 +0000)]
gv_check(): use aux flag rather than IsCOW
Currently the SVf_IsCOW flag doesn't have any meaning for HVs,
except that it is used in the specific case of gv_check() to temporarily
mark a stash as being scanned. Since stashes will have the HV_AUX fields,
we can use a flags bit in the new xhv_aux_flags field instead.
This then potentially frees up the SVf_IsCOW for use as a new general flag
bit for *all* HVs (including non-stash ones).
David Mitchell [Sat, 15 Feb 2014 16:15:11 +0000 (16:15 +0000)]
add aux_flags field to HVs with aux struct
Add an extra U32 general flags field to the xpvhv_aux struct (which is
used on HVs such as stashes, that need extra fields).
On 64-bit systems, this doesn't consume any extra space since there's
already an odd number of I32/U32 fields. On 32-bit systems it will consume
an extra 4 bytes. But of course only on those hashes that have the aux
struct.
As well as providing extra flags in the AUX case, it will also allow
us to free up at least one general flag bit for HVs - see next commit.
David Mitchell [Sun, 23 Feb 2014 00:53:17 +0000 (00:53 +0000)]
make OP_AELEMFAST work with negative indices
Use aelemfast for literal index array access where the index is in the
range -128..127, rather than 0..255.
You'd expect something like $a[-1] or $a[-2] to be a lot more common than
$a[100] say. In fact a quick CPAN grep shows 66 distributions
matching /\$\w+\[\d{3,}\]/, but "at least" 1000 matching /\$\w+\[\-\d\]/.
And most of the former appear to be table initialisations.
David Mitchell [Thu, 27 Feb 2014 16:32:34 +0000 (16:32 +0000)]
[MERGE] optmise pp_entersub code
Do various bits of minor fiddling with the code of Perl_pp_entersub
to make the binary smaller and hopefully faster. All the usual stuff:
sprinkling LIKELY(), altering scope of vars etc.
All of this should make no functional difference, expect conceivably the
"SvPADTMP() not on IS_PADGV()" change (which also affects code outside
pp_entersub()).
This series of commits reduces the size of the pp_entersub object on gcc
x86_64 by about 11%, and shows no measurable change in performance (i.e.
noise dominates).
David Mitchell [Thu, 27 Feb 2014 15:30:26 +0000 (15:30 +0000)]
don't set SvPADTMP() on PADGV's
Under threaded builds, GVs for OPs are stored in the pad rather than
being directly attached to the op. For some reason, all such GV's were
getting the SvPADTMP flag set. There seems to be be no good reason for
this, and after skipping setting the flag, all tests still pass.
The advantage of not setting this flag is that there are quite a few
hot places in the code that do
if (SvPADTMP(sv) && !IS_PADGV(sv)) {
...
I've replaced them all with
if (SvPADTMP(sv)) {
assert(!IS_PADGV(sv));
...
Since the IS_PADGV() macro expands to something quite heavyweight, this is
quite a saving: for example this commit reduces the size of pp_entersub by
111 bytes.
David Mitchell [Wed, 26 Feb 2014 22:39:52 +0000 (22:39 +0000)]
pp_entersub(): simplify XSUB arg cleanup code
The code that reduces the returned XS args to 1 arg in scalar context
was a bit messy. This makes it smaller, more comprehensible, with slighylu
smaller object size.
David Mitchell [Wed, 26 Feb 2014 20:54:05 +0000 (20:54 +0000)]
move PL_defgv nearer the top of intrvar.h
on the grounds that its a reasonably hot variable.
David Mitchell [Wed, 26 Feb 2014 20:47:32 +0000 (20:47 +0000)]
pp_entersub(): tweak some vars
make the scope of item be smaller;
don't assign +1 to MARK when we will shortly overwrite it;
use a local var to to store &GvAV(PL_defgv) to avoid recalculating it
use a _NN variant of SvREFCNT_inc
Shaves 2% off the object size of pp_entersub.
David Mitchell [Wed, 26 Feb 2014 18:03:56 +0000 (18:03 +0000)]
pp_entersub(): assign CvDEPTH to a local var
stop repeatedly retrieving it
David Mitchell [Wed, 26 Feb 2014 17:47:47 +0000 (17:47 +0000)]
pp_entersub(): re-indent block
the previous commit wrapped a switch statement in an if(), so re-indent
accordingly. Whitespace-only change.
David Mitchell [Wed, 26 Feb 2014 17:38:33 +0000 (17:38 +0000)]
tweak pp_entersub
liberally sprinkle some LIKELY()s, initialise gimme closer to where
it's first needed, and shortcut the common case of a GV with valid CV,
skipping the switch statement.
With gcc and x86_64, this reduces the code size of the function by
about 5%.
Steffen Mueller [Thu, 27 Feb 2014 07:22:17 +0000 (08:22 +0100)]
Remove spurious assert
kid is always dereferenced before the assert.
Steve Hay [Wed, 26 Feb 2014 22:26:45 +0000 (22:26 +0000)]
Remove leftover Windows 95 / Windows NT4 support code
We only support building or running on Windows 2000 or higher, as of the
Windows 95 Chainsaw Massacre commit (
8cbe99e5b6). These three chunks of
code escaped the massacre, but the chainsaw has finally caught up with them
now.
Steffen Mueller [Wed, 26 Feb 2014 20:51:56 +0000 (21:51 +0100)]
List-OP removal: Fix compile fail on C90
Apologies. I'd applied Reini's patch to my optimization branch. I think
it got lost when I switched to Dave's variant my original code (which
didn't have Reini's C90 fix). Sorry!
Steffen Mueller [Sat, 22 Feb 2014 09:08:25 +0000 (10:08 +0100)]
Optimization: Remove needless list/pushmark pairs from the OP execution
This is an optimization for OP trees that involve list OPs in list
context. In list context, the list OP's first child, a pushmark, will do
what its name claims and push a mark to the mark stack, indicating the
start of a list of parameters to another OP. Then the list's other
child OPs will do their stack pushing. Finally, the list OP will be
executed and do nothing but undo what the pushmark has done. This is
because the main effect of the list OP only really kicks in if it's
not in array context (actually, it should probably only kick in if
it's in scalar context, but I don't know of any valid examples of
list OPs in void contexts).
This optimization is quite a measurable speed-up for array or hash
slicing and some other situations. Another (contrived) example is
that (1,2,(3,4)) now actually is the same, performance-wise as
(1,2,3,4), albeit that's rarely relevant.
The price to pay for this is a slightly convoluted (by standards other
than the perl core) bit of optimization logic that has to do minor
look-ahead on certain OPs in the peephole optimizer.
A number of tests failed after the first attack on this problem. The
failures were in two categories:
a) Tests that are sensitive to details of the OP tree structure and did
verbatim text comparisons of B::Concise output (ouch). These are just
patched according to the new red in this commit.
b) Test that validly failed because certain conditions in op.c were
expecting OP_LISTs where there are now OP_NULLs (with op_targ=OP_LIST).
For these, the respective conditions in op.c were adjusted.
The change includes modifying B::Deparse to handle the new OP tree
structure in the face of nulled OP_LISTs.
Steffen Mueller [Fri, 21 Feb 2014 17:58:04 +0000 (18:58 +0100)]
Macro for common OP checks: "is this X or was it before NULLing?"
For example,
if (OP_TYPE_IS_OR_WAS(o, OP_LIST))
...
is now available instead of either of the following:
if ( o
&& ( o->op_type == OP_LIST
|| (o->op_type == OP_NULL
&& o->op_targ == OP_LIST) ) )
...
if ( o &&
(o->op_type == OP_NULL ? o->op_targ ? o->op_type) == OP_LIST )
...
In case the above logic is a bit unclear: It checks whether that OP is
an OP_LIST or used to be one before being NULLed using op_null.
(FTR, the resulting OP_NULLs have their op_targ set to the old OP type).
This sort of check (and it's reverse "isn't and didn't use to be") are a
relatively common pattern in the part of op.c that tries to intuit
structures from optimization-mangled OP trees. Hopefully, using these
macros will make some code a fair amount clearer.
Steve Hay [Wed, 26 Feb 2014 08:19:11 +0000 (08:19 +0000)]
Remove IO::Socket::IP examples as per Porting/Maintainers.pl
Chris 'BinGOs' Williams [Tue, 25 Feb 2014 11:16:00 +0000 (11:16 +0000)]
Update Pod-Perldoc to CPAN version 3.23
[DELTA]
3.23 - Sun Feb 23 18:54:43 UTC 2014
* Release 3.23
Yes, this is a packaging error. Mea culpa. In the future
test releases will be 3.23_01, etc.
See https://twitter.com/frioux/status/
429245594180128769
for context.
3.22_02 - Wed Feb 5 05:08:34 UTC 2014
* Add a pager that doesn't redirect stdin RT#85173
Added a special pager environment variable for use
when perldoc is in the -m mode that doesn't
redirect STDIN. Set PERLDOC_SRC_PAGER to use.
As in:
PERLDOC_SRC_PAGER=/usr/bin/vim perldoc -m File::Temp
* Teach ToTerm.pm to get terminal width RT#85467
Get a terminal width and pass it to Pod::Text::Termcap
from one of these sources (in order):
1. An explicit width set from command line with -w
2. MANWIDTH environment variable
3. stty output
4. The default width of 76 (same as Pod::Text)
3.22_01 - Sat Feb 1 05:00:13 UTC 2014
* Match =item more carefully when scanning perlfunc.
Fixes RT #86795. Previously matches could be generated
on words like 'size' and 'precision' which are not
Perl functions.
* Cleanup code related to mandoc RT #85844
Patch by Ingo Schwarze
* Re-add '-U' flag to skip attempting to drop
privileges. RT #87837
* Do not install to INSTALLDIRS after Perl 5.11 RT #89756
* Refactor search_perlop (finds operators like 'q'
'qq' 'tr' and others) RT #86506. Previously most of
the text generated was incorrect.
* Fix wrong version in DEBUG output from ToTerm.pm RT #85468
* Fix POD errors when scanning parts of perlfunc RT #86472
Patch by Shlomi Fish.
Chris 'BinGOs' Williams [Tue, 25 Feb 2014 11:10:09 +0000 (11:10 +0000)]
Update CPAN-Meta-YAML to CPAN version 0.012
Includes
cc53c151 fix for VMS
[DELTA]
0.012 2014-02-24 13:07:18-05:00 America/New_York
- Generated from ETHER/YAML-Tiny-1.61.tar.gz
Chris 'BinGOs' Williams [Tue, 25 Feb 2014 11:04:29 +0000 (11:04 +0000)]
Update IO-Socket-IP to CPAN version 0.29
[DELTA]
0.29 2014/02/24 16:06:29
[BUGFIXES]
* Workaround for OSes that disobey AI_ADDRCONFIG and yield AIs on
families the kernel will not support anyway (e.g. HPUX)
* Workaround for OSes that lack getprotobyname() (e.g. Android)
Yves Orton [Tue, 25 Feb 2014 11:07:18 +0000 (12:07 +0100)]
Fix RT #121321 - Fencepost error causes infinite loop in regex compilation
Due to a fencepost error if a pattern had more than 9 capture buffers
and after the last capture buffer there was an octal style escape which
when interpreted as decimal evaluated to one more than the number of
defined buffers then the regex compiler would go into an infinite loop.
This fixes the fencepost error, adds tests, and adds some comments to
explain what is going on.
Nicholas Clark [Tue, 25 Feb 2014 10:36:26 +0000 (11:36 +0100)]
Use a temporary file instead of $^X when testing stat.
Otherwise there's a subtle race condition on the last access time, which can
cause the test to spuriously fail. I'm surprised that we've not seen this
failure until today.
Steve Hay [Tue, 25 Feb 2014 08:59:07 +0000 (08:59 +0000)]
Silence some VC++ compiler warnings
gv.c(1455) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
gv.c(1586) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
gv.c(2122) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
toke.c(12423) : warning C4244: '=' : conversion from 'I32' to 'char', possible loss of data
win32.c(3017) : warning C4022: 'SetHandleInformation' : pointer mismatch for actual parameter 1
win32.c(2971) : warning C4101: 'old_h' : unreferenced local variable
win32.c(2967) : warning C4101: 'oldfd' : unreferenced local variable
Karl Williamson [Mon, 24 Feb 2014 19:00:03 +0000 (12:00 -0700)]
lib/locale.t: Make more tests not fail unless is bad for enough locales
locale.t has some tests that fail even one locale fails; and it has some
tests where failure doesn't happen unless a sufficient percentage of
locales have the same problem.
The first set should be for tests whose failure indicates a basic
problem in locale handling; and the second set should be for tests where
it could be that just a locale definition is bad.
Prior to this patch, tests dealing with radix problems were considered
in the first category, but in fact it's possible that just the locale
definition for the radix is wrong. This is what happened for some older
Darwin versions for their Basque locales, which caused locale.t to show
failures, whereas it was just these locales that were bad, and the
generic handling was ok, or good enough. (The actual failures had the
radix be the two character string: apostrophe followed by a blank. It
would be a lot of work to make Perl deal with having a quote character
also mean a decimal point, and that work isn't worth it, especially as
this was a locale definition error, and we don't know of any locale in
the world where an apostrophe is legitimately a radix character.)
For this commit, I looked through the tests, and I added the tests where
it seemed that the problem could just be a bad locale definition to the
list of such tests. Note that failures here could mean an internal Perl
error, but in that case, it should affect many more locales, so will
show up anyway as the failure rate should exceed the acceptable one.
Karl Williamson [Mon, 24 Feb 2014 18:56:47 +0000 (11:56 -0700)]
lib/locale.t: Change an array to a hash
This is more naturally a hash in that it is a list of numbers, not
necessarily consecutive, and each time through the loop the same number
was getting pushed, so had multiple entries for each by the time it was
finished.
Steffen Mueller [Mon, 24 Feb 2014 17:07:16 +0000 (18:07 +0100)]
Missing version bump for Deparse
Not a good run, I am having. But also not anything tangible
that our silly tests caught me on. :(
Steffen Mueller [Mon, 24 Feb 2014 17:00:08 +0000 (18:00 +0100)]
Test fix: Update list of B::Concise functions
Imagine there was a test that actually broken open a core module's
package and looked at all of its subs and compared it to a hardcoded
list of "constant" and "xs" functions. That would be madness, wouldn't
it? Breaking encapsulation, no less? Require tedious synchronization?
m(
Steffen Mueller [Mon, 24 Feb 2014 13:39:08 +0000 (14:39 +0100)]
B::Deparse: Padrange deparse fix
The PADRANGE support fakes up a PUSHMARK OP but until this commit, it
did so incompletely since it never overrode the OP type (that was still
an OP_PADRANGE). This addresses that.
On top of it, there's two minor changes that switch from "eq" to "=="
for comparing numeric OP types.
Yves Orton [Sun, 23 Feb 2014 19:53:51 +0000 (20:53 +0100)]
fix RT #121299 - Inconsistent behavior with backreferences nested inside subpattern references
Match variables should be dynamically scoped during GOSUB and GOSTART.
The callers state should be inherited by the callee, but once the callee
returns, the callers state should be restored.
This is different from EVAL, where the callers and callees state are
expected to not be the same (although might be the same), and where
the "reasonable" match semantics differ. Currently the following two
one liners will produce different results:
$ ./perl -Ilib -le'"<ab><>>" =~/ < (?: \1 | [ab]+ ) (>) (?0)? /x and print $&;'
<ab><>>
$ ./perl -Ilib -le'$qr= qr/ < (?: \1 | [ab]+ ) (>) (??{ $qr })? /x; "<ab><>>" =~ m/$qr/ and print $&;'
<ab>
While I think reasonable people could argue that we should special case
things when we know that the return from (??{ ... }) is the same as the
currently executing pattern I think explaining the difference would be
harder than necessary.
On the contrary making GOSUB/GOSTART exactly the same as EVAL, so that
the match vars were totally independent seems to throw away an
opportunity for much more powerful semantics than can be offered by
EVAL.
Yves Orton [Sun, 23 Feb 2014 17:59:48 +0000 (18:59 +0100)]
Improve how regprop dumps REF-like nodes during execution
We pass in the regmatch_info struct, which allows us to dump
what a given REF is going to match.
Yves Orton [Fri, 21 Feb 2014 11:54:02 +0000 (12:54 +0100)]
comments and whitespace fixups to inprove clarity of the code
Craig A. Berry [Mon, 24 Feb 2014 02:47:07 +0000 (20:47 -0600)]
test nit in CPAN-Meta-YAML/t/31_local_tml.t
Directories on VMS have a .DIR extension. This test appears to be
constructing method names from directory names, so we need to trim off
the extension to get it to pass.
Awaiting upstream application at:
https://rt.cpan.org/Public/Bug/Display.html?id=93297
David Mitchell [Sun, 23 Feb 2014 16:04:38 +0000 (16:04 +0000)]
fix win32 build
dca36a0cc embedded #ifdefs within a macro call, which is naughty (I
think). So have the ifdef outside the macro instead
Father Chrysostomos [Mon, 17 Feb 2014 06:25:27 +0000 (22:25 -0800)]
[perl #121259] Always allow COW after $input=<>
sv_grow provides an extra byte for the sake of copy-on-write’s buffer
reference count, but skips this for multiples of 256 (though the com-
ments there say powers of two).
When we do
$input=<>
The assignment is optimised away and the allocation takes place in
sv_gets. In that code path, we know we don’t need a nice power of
two and allocating an extra byte won’t hurt, so go ahead and add an
extra byte.
This speeds up code doing m//g on $input, because it avoids the pre-
match copy.
Chris 'BinGOs' Williams [Fri, 21 Feb 2014 16:08:01 +0000 (16:08 +0000)]
Module-CoreList 3.07 released to CPAN, bump core version to 3.08
Steve Hay [Fri, 21 Feb 2014 08:37:37 +0000 (08:37 +0000)]
Fix syncing of Config-Perl-V with CPAN version 0.20
Commit
d0fa2fb96e removed some erroneous changes made by commit
0b39d4dc4a
but didn't quite restore 21_plv518.t to match the CPAN version.
Steve Hay [Fri, 21 Feb 2014 08:12:35 +0000 (08:12 +0000)]
Upgrade HTTP-Tiny from version 0.042 to 0.043
Tony Cook [Fri, 21 Feb 2014 04:15:26 +0000 (15:15 +1100)]
Tony Cook [Mon, 17 Feb 2014 04:21:34 +0000 (15:21 +1100)]
bump $base::VERSION to 2.22
Tony Cook [Mon, 17 Feb 2014 04:19:34 +0000 (15:19 +1100)]
[perl #121196] only examine the name being included
Checking the location called from broke require overrides.
Tony Cook [Fri, 21 Feb 2014 03:47:05 +0000 (14:47 +1100)]
Chris 'BinGOs' Williams [Thu, 20 Feb 2014 23:31:43 +0000 (23:31 +0000)]
Update Module-Load to CPAN version 0.32
[DELTA]
0.32 Thu Feb 20 22:53:19 GMT 2014
* Fix tests to support statically built perls
Craig A. Berry [Thu, 20 Feb 2014 22:25:28 +0000 (16:25 -0600)]
Only define Perl__get_regclass_nonbitmap_data once.
It was added in
77d654fbc7477bd but since it is exported, it
should not be defined in both the core and the extension versions
of regex code. Doing so causes a multiply defined symbol warning
in the VMS linker and results in a build failure. It might cause
trouble in any other environment with a strict linker.
Tony Cook [Thu, 20 Feb 2014 22:12:58 +0000 (09:12 +1100)]
[perl #120939] at least fix the leak in const_av_xsub
Chris 'BinGOs' Williams [Thu, 20 Feb 2014 20:56:46 +0000 (20:56 +0000)]
Update ExtUtils-MakeMaker to CPAN version 6.90
[DELTA]
6.90 Thu Feb 20 20:46:04 GMT 2014
No changes from 6.89_01
6.89_01 Mon Feb 17 15:56:39 GMT 2014
Bug fixes:
* Libraries are not transitive on Android
Karl Williamson [Thu, 20 Feb 2014 18:29:15 +0000 (11:29 -0700)]
Restore proper functioning of -Mdiagnostics
Commit
1c604e7c7f fixed some pod errors, but broke
./perl -Ilib -Mdiagnostics -e '$/=[]'
This fixes that.
Karl Williamson [Thu, 20 Feb 2014 18:10:39 +0000 (11:10 -0700)]
Change 'semantics' to 'rules'
The term 'semantics' in documentation when applied to character sets is
changed to 'rules' as being a shorter less-jargony synonym in this case.
This was discussed several releases ago, but I didn't get around to it.
Karl Williamson [Thu, 20 Feb 2014 17:28:58 +0000 (10:28 -0700)]
Change av_len calls to av_tindex for clarity
av_tindex is a more clearly named synonym for av_len, available starting
in v5.18. This changes the core uses to it, including modules in /ext,
which are not dual-lifed.
Karl Williamson [Thu, 20 Feb 2014 17:23:23 +0000 (10:23 -0700)]
Bump version numbers
These four core-only modules are about to be changed so that they call
av_tindex instead of av_len. There's no chance that any of the version
numbers will need to be reverted, as we think that bumping a single-life
module's version is harmless.
Nicholas Clark [Thu, 20 Feb 2014 15:54:09 +0000 (16:54 +0100)]
Update ribasushi's e-mail address.
Peter Rabbitson [Thu, 20 Feb 2014 15:14:42 +0000 (16:14 +0100)]
Fix pod typo (kentnl++)
H.Merijn Brand [Thu, 20 Feb 2014 11:00:15 +0000 (12:00 +0100)]
One typo fix was missed in upgrading Config::Perl::V to 0.20
The modified for blead change has been reverted
The -V output as checked for 5.10.x and 5.18.x will not change
with changes in blead.
I will add new test files for all most recent maint releases
and will add one for 5.10.0 when it is out
Chris 'BinGOs' Williams [Thu, 20 Feb 2014 10:54:58 +0000 (10:54 +0000)]
Module-CoreList 3.06 released to CPAN
H.Merijn Brand [Thu, 20 Feb 2014 10:37:47 +0000 (11:37 +0100)]
Amend Porting/core-cpan-diff
Allow -v with -x
Show diff for customized scripts when -d and -v
Allow -v #
Set -d if -v 3 and up
Tony Cook [Thu, 20 Feb 2014 07:10:51 +0000 (18:10 +1100)]
prepare Module::CoreList for next release
Tony Cook [Thu, 20 Feb 2014 05:32:01 +0000 (16:32 +1100)]
bump to version 5.19.10 and fix the version number reference in op.c
Tony Cook [Thu, 20 Feb 2014 05:06:18 +0000 (16:06 +1100)]
new perldelta for 5.19.10
Tony Cook [Thu, 20 Feb 2014 05:02:57 +0000 (16:02 +1100)]
avoid leaving the old perldelta as a symlink
In a built tree, the name we copy perldelta.pod to is a symlink to
perldelta.pod, and if you blindly follow the git adds, you end up
adding a symlink to the commit.
unlink() the name we're about to overwrite before we overwrite it to
prevent that.
Tony Cook [Thu, 20 Feb 2014 04:56:00 +0000 (15:56 +1100)]
record the 5.19.9 epigraph
Tony Cook [Thu, 20 Feb 2014 04:40:24 +0000 (15:40 +1100)]
merge 5.19.9 release branch
Karl Williamson [Thu, 20 Feb 2014 04:14:44 +0000 (21:14 -0700)]
regcomp.c: Don't read uninitialized data
I keep forgetting that the OP of a regnode is not defined in Pass 1 of
the regex compiler. This is likely the cause of inconsistent results in
lib/locale.t, as valgrind shows there to be a read of uninitialized
data before this patch, and the result is randomly tainting when there
shouldn't be, consistent with the test failures.
Tony Cook [Thu, 20 Feb 2014 03:24:53 +0000 (14:24 +1100)]
note lib/locale.t rare failure
Tony Cook [Thu, 20 Feb 2014 02:50:08 +0000 (13:50 +1100)]
update perlhist for 5.19.9
Tony Cook [Thu, 20 Feb 2014 02:44:11 +0000 (13:44 +1100)]
finalize perldelta for 5.19.9
Tony Cook [Thu, 20 Feb 2014 00:22:22 +0000 (11:22 +1100)]
Update Module::CoreList for 5.19.9
Karl Williamson [Thu, 20 Feb 2014 00:11:33 +0000 (17:11 -0700)]
lib/locale.t: Remove tests that need UTF-8 locale
These tests should not be here because they will only match under a
UTF-8 locale, which happens to be the case on the machine I developed
them on, but not necessarily always true, and so they are failing.
Given the deadline is already past, I'm just removing them for now, and
will re-add them later in another place in the file where we know we
are using a UTF-8 locale.
Karl Williamson [Wed, 19 Feb 2014 22:39:18 +0000 (15:39 -0700)]
locale.c: Change 'and' to '&&'
To actually compile on Windows
Karl Williamson [Wed, 19 Feb 2014 22:33:00 +0000 (15:33 -0700)]
run/locale.t: White-space only
Align a column
Karl Williamson [Wed, 19 Feb 2014 22:31:07 +0000 (15:31 -0700)]
locale.c: Another POSIX emulation fix on Windows
Right after I pushed the previous commit, I realized that the system
default locale on Windows should also have lower priority (besides LANG)
than the LC_foo environment variables. This should do that.
Karl Williamson [Wed, 19 Feb 2014 21:55:29 +0000 (14:55 -0700)]
.locale.c: Better emulate POSIX locale setting on Windows
Commit
b385bb4ddcb252e69a1044d702646741e2e489fb introduced
my_setlocale() compiled only under Windows which emulates the POSIX
rules for setting the locale. It differs from Windows only if the
locale passed in is "". Unfortunately it was buggy if the category
being set was LC_ALL, and there is a LANG environment variable. LANG
has lower precedence than the other environment variables, like
LC_NUMERIC, but my_setlocale() was giving it higher priority when set
through LC_ALL.
This should solve the problems being seen since
7cd8b56846670e577e1f62479eab8f38fb11da14
Karl Williamson [Tue, 18 Feb 2014 19:59:26 +0000 (12:59 -0700)]
Make taint checking regex compile time instead of runtime
See discussion at https://rt.perl.org/Ticket/Display.html?id=120675
There are several unresolved items in this discussion, but we did agree
that tainting should be dependent only on the regex pattern, and not the
particular input string being matched against:
"The bottom line is we are moving to the policy that tainting is based
on the operation being in locale, without regard to the particular
operand's contents passed this time to the operation. This means simpler
core code and more consistent tainting results. And it lessens the
likelihood that there are paths in the core that should taint but don't"
This commit does the minimal work to change regex pattern matching to
determine tainting at pattern compilation time. Simply put, if a
pattern contains a regnode whose match/not match depends on the run-time
locale, any attempt to match against that pattern will taint, regardless
of the actual target string or runtime locale in effect. Given this
change, there are optimizations that can be made to avoid runtime work,
but these are deferred until later.
Note that just because a regular expression is compiled under locale
doesn't mean that the generated pattern will be tainted. It depends on
the actual pattern. For example, the pattern /(.)/ doesn't taint
because it will match exactly one character of the input, regardless of
locale settings.
Karl Williamson [Tue, 18 Feb 2014 18:37:10 +0000 (11:37 -0700)]
lib/locale.t: Add some test names
Karl Williamson [Tue, 18 Feb 2014 18:45:48 +0000 (11:45 -0700)]
lib/locale.t: Untaint before checking if next thing taints
The tests weren't testing what they purported to, as we should be sure
to start with untained values to see if the operation taints.
Karl Williamson [Wed, 19 Feb 2014 16:37:51 +0000 (09:37 -0700)]
perllocale: Add note about ENVIRONMENT variable
This variable is part of the environment, but wasn't previously
mentioned.
Karl Williamson [Wed, 19 Feb 2014 16:36:39 +0000 (09:36 -0700)]
perlsec: Nit
H.Merijn Brand [Wed, 19 Feb 2014 16:39:00 +0000 (17:39 +0100)]
Update Config::Perl::V to 0.20
David Golden [Wed, 19 Feb 2014 16:01:40 +0000 (11:01 -0500)]
perlootut: replace Object::Tiny with Class::Tiny
Class::Tiny is similarly small and simple in API, but with more powerful
features available. Comparison to Object::Tiny and Class::Accessor is
here: https://metacpan.org/pod/Class::Tiny#RATIONALE
At mst's suggestion, a link to Class::Tiny::Antlers for Moose-syntax
is included.
H.Merijn Brand [Wed, 19 Feb 2014 16:07:32 +0000 (17:07 +0100)]
New bincompat options
Karl Williamson [Wed, 19 Feb 2014 05:07:56 +0000 (22:07 -0700)]
regcomp.c: Remove no longer used function
I don't think this function will need to be used again.
Karl Williamson [Tue, 18 Feb 2014 18:01:23 +0000 (11:01 -0700)]
regcomp.c: Move some locale initialization code
This moves some code down a few lines, rewording the comments, and doing
some things only once, instead of each time through the loop.
This eliminates some tests, as the new place already has determined that
some of the preconditions for executing the code have been met. It
keeps us from generating unnecessary locale nodes for platforms which
don't have isascii().
Karl Williamson [Tue, 18 Feb 2014 17:47:15 +0000 (10:47 -0700)]
regcomp.c,regexec.c: White-space only
Properly indent two sections of code newly enclosed in braces by the
previous commit
Karl Williamson [Tue, 18 Feb 2014 17:24:31 +0000 (10:24 -0700)]
regcomp.c: Fix more alignment problems
I believe this will fix the remaining alignment problems recently being
shown on gcc on HP-UX, It works on the procura machine.
regnodes should not have stricter alignment than required by U32, for
reasons given in the comments this commit adds to the beginning of
regcomp.h. Commit
31f05a37 added a new ANYOF regnode struct with a
pointer field. This requires stricter alignment on some 64-bit platforms,
and hence doesn't work on those platforms.
This commit removes that regnode struct type, and instead stores the
pointer it used via a more indirect, but already existing mechanism
that stores other data..
The function that returns that other data is enlarged to return this new
field as well. It now needs to be called from regcomp.c, so the
previous commit had renamed and made it accessible from there. The
"public" function that wraps this one is unchanged. (I put "public" in
quotes here, because I don't think anyone outside core is or should be
using it, but since it has been publicly available for a long time, I'm
treating the API as unchangeable. regcomp.c called this public function
before this commit, but needs the additional data returned by the inner
one).
Karl Williamson [Tue, 18 Feb 2014 16:05:09 +0000 (09:05 -0700)]
regexec.c: Rename function, add parameter, make non-static
This is in preparation for a future commit where the function does more
things so its current name would be misleading. It will need to be
callable from regcomp.c as well.
Karl Williamson [Tue, 18 Feb 2014 15:57:48 +0000 (08:57 -0700)]
regcomp.h: Allow compiler to perform calculation
Instead of doing the calculation of how many bytes a 256 bitmap
occupies, let the compiler do it. I believe we are not too far away
from having the ability to allow applications to recompile Perl to
increase the bitmap size trading speed for memory. ICU has an 8192
bitmap last time I checked.
Karl Williamson [Mon, 17 Feb 2014 23:04:06 +0000 (16:04 -0700)]
regexec.c: Add some checks
These aren't currently needed, but a future commit will change so things
need to be more general
Karl Williamson [Mon, 17 Feb 2014 22:39:12 +0000 (15:39 -0700)]
Change method of passing some info from regcomp to regexec
For the last several releases, the fact that an ANYOF node could match
something outside its bitmap has been passed to regexec.c by having its
ARG field not be -1 (appropriately cast). A bit was set if the match
could occur even if the target string was not UTF-8 encoded. This
design was used to save a bit, as previously there was a bit also for it
matching UTF-8 strings.
That design is no longer tenable, as a future commit will have a third
(independent) reason for something to match outside the bitmap, This
commits uses the current spare bit flag to indicate if the match can
only occur if the target string is UTF-8.
Karl Williamson [Mon, 17 Feb 2014 22:40:50 +0000 (15:40 -0700)]
regcomp.h: Remove extraneous comment
This is obsolete and is a partial copy of the up-to-date comment below
it.
Karl Williamson [Mon, 17 Feb 2014 20:57:11 +0000 (13:57 -0700)]
regcomp.h: Free up flag bit in ANYOF nodes
The ANYOF_LOC bit was removed from final use in the previous commit.
Karl Williamson [Mon, 17 Feb 2014 20:47:00 +0000 (13:47 -0700)]
regexes: Remove uses of ANYOF_LOCALE flag
This flag no longer adds any useful information and can be removed. An
ANYOF node that depends on locale either matches a POSIX class like /d,
or matches case insensitively, or both. There are flags for both these
cases, and to see if something matches locale, one merely needs to see
if either flag is set.
Not having to keep track of this extra flag simplifies things, and will
allow it to be removed. There was a time when this flag was shared with
one of the remaining locale ones, and there was relict code that allowed
that sharing to be reinstated, and which this commit also removes.
Karl Williamson [Mon, 17 Feb 2014 19:49:10 +0000 (12:49 -0700)]
regcomp.c: Simplify /l Synthetic Start Class construction
The ANYOF_POSIXL flag is needed in general for ANYOF nodes to indicate
if the struct contains an extra U32 element used to hold the list of
POSIX classes (like \w and [:punct:]) whose matches depend on the locale
in effect at the time of runtime pattern matching.
But the SSC always contains this U32, and so doesn't need to use the
flag. Instead, if there aren't any such classes, the U32 will be zero.
Removing keeping track of this flag during the assembly of the SSC
simplifies things. At the completion of this process, this flag is
set if the U32 is non-zero to pass that information on to regexec.c so
that it doesn't have to special case things.
Karl Williamson [Sat, 15 Feb 2014 21:45:03 +0000 (14:45 -0700)]
Convert more EXACTFish nodes to EXACT when possible
Under /i matching, many characters match only themselves, such a
punctuation. If a node contains only such characters it can be an EXACT
node. The optimizer gets better hints when dealing with EXACT nodes
than ones with folding.
This changes the alloc_maybe_populate() function to look for
possibilities of non-folding input.
Rafael Garcia-Suarez [Wed, 19 Feb 2014 14:41:51 +0000 (15:41 +0100)]
Do not dereference hv before ensuring it's not NULL
This should fix RT #116441 and possibly other bugs.
Tony Cook [Wed, 19 Feb 2014 09:26:38 +0000 (20:26 +1100)]
perldelta updates
Tony Cook [Wed, 19 Feb 2014 04:12:31 +0000 (15:12 +1100)]
save errno/$! across Win32.pm autoloads too
Tony Cook [Wed, 19 Feb 2014 04:01:06 +0000 (15:01 +1100)]
cygwin doesn't implement $^E (except as a read of $!)
On Cygwin, reading $^E actually reads $!, as it does on other non-
VMS/Win32/OS/2 platforms. Setting it does nothing.
James E Keenan [Wed, 19 Feb 2014 02:27:30 +0000 (03:27 +0100)]
Correct number of tests in plan.