This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
9 years agoPOSIX::setlocale(LC_NUMERIC) returns proper locale
Karl Williamson [Mon, 7 Jul 2014 21:14:49 +0000 (15:14 -0600)]
POSIX::setlocale(LC_NUMERIC) returns proper locale

Commit 4c28b29c7a1549f173177cdf69e91cc1acaa0969 broke calling setlocale
with a single parameter and hoping to get the correct LC_NUMERIC
property returned from it (including LC_ALL calls).  This is because the
numeric locale is now kept as C except around the code that wants it to
be the underlying locale.  It turns out that querying the current locale
is such a code area, so LC_NUMERIC is now set to the underlying locale
around this.

9 years agolocale.c: White-space only
Karl Williamson [Mon, 7 Jul 2014 20:42:11 +0000 (14:42 -0600)]
locale.c: White-space only

Outdent because the previous commit removed the enclosing block.

9 years agolocale.c: Remove conditionals.
Karl Williamson [Mon, 7 Jul 2014 20:38:08 +0000 (14:38 -0600)]
locale.c: Remove conditionals.

These two functions are supposed to normally be called through macro
interfaces which check whether they actually should be called or not.
That means the conditionals removed by this commit are redundant from
the normal interface.   By removing them, we allow the exceptional case
where the code should be executed unconditionally, to happen, by just
calling the functions directly, not using the macro interface.

9 years agolocale.c: Keep better track of C/non-C locale
Karl Williamson [Mon, 7 Jul 2014 20:30:59 +0000 (14:30 -0600)]
locale.c: Keep better track of C/non-C locale

Perl uses three interpreter-level (but private) variables to keep track
of numeric locales.  PL_numeric name is the current underlying locale.
PL_standard is a boolean to indicate if we are switched to the C (or
POSIX) locale, and PL_local is a boolean to indicate if we are switched
to the underlying one.  The reason there are two booleans is if the
underlying locale is C, both can be true at the same time.  But the code
that is being changed by this commit didn't realize this, and
could unnecessarily set the booleans to FALSE.  This could cause
unnecessary switching of locales.

9 years agolocale.c: Make a common idiom into a macro
Karl Williamson [Mon, 7 Jul 2014 20:21:30 +0000 (14:21 -0600)]
locale.c: Make a common idiom into a macro

9 years agolib/locale.t: Fix debug statement
Karl Williamson [Mon, 7 Jul 2014 19:59:30 +0000 (13:59 -0600)]
lib/locale.t: Fix debug statement

This was printing using the wrong function.  It is a string, and should
use the string output function.

9 years agoutf8.h: Add comment
Karl Williamson [Sun, 29 Jun 2014 03:43:02 +0000 (21:43 -0600)]
utf8.h: Add comment

9 years agoUpdate which stable release series are now "officially" supported
Steve Hay [Wed, 9 Jul 2014 07:36:32 +0000 (08:36 +0100)]
Update which stable release series are now "officially" supported

9 years agoFix typo in op.h
Aaron Crane [Tue, 8 Jul 2014 23:33:47 +0000 (00:33 +0100)]
Fix typo in op.h

This caused all OP structures to be larger than intended; for example, it
made `struct op` 48 bytes rather than 40 on Mac OS X x86-64.

9 years ago[Merge] add support for ops to link to parent
David Mitchell [Tue, 8 Jul 2014 15:44:53 +0000 (16:44 +0100)]
[Merge] add support for ops to link to parent

This series of commits provides experimental support for ops in the optree
to be able to locate their parent op, if any.

First, it adds a new general-purpose function, op_sibling_splice(),
which allows for general manipulation of an op_sibling chain by analogy
with the perl splice() function. op.c has then been heavily refactored to
use this function rather than manipulating ops directly.

Then the boolean field op_lastsib has been added to OPs. Within the core,
this is set on the last op in an op_sibling chain (so it is synonymous
with op_sibling being null). By default, its value is set but not used.

In addition, a new build define has been added (not yet enabled by default),
-DPERL_OP_PARENT, that forces the core to use op_lastsib to detect the
last op in a sibling chain, rather than op_sibling being NULL. This frees
up the last op_sibling pointer in the chain, which rather than being set
to NULL, is now set to point back to the parent of the sibling chain (if
any).

Then add a C-level op_parent() function and B parent() method; under
default builds they just return NULL, under PERL_OP_PARENT they return the
parent of the current op.

Collectively this provides a facility not previously available from B:: nor
C, of being able to follow an op tree up as well as down.

Also, some assertions are added to finalize_op() that check the
consistency of the optree; in particular that op_last points to the last
sibling. Under -DPERL_OP_PARENT, more checks are enabled.

9 years agoavoid adding two OP_HINTSEVAL ops
David Mitchell [Tue, 1 Jul 2014 14:42:42 +0000 (15:42 +0100)]
avoid adding two OP_HINTSEVAL ops

Under argless eval (i.e. defaults to $_) in the presence of hints,
the perl core was recursively calling ck_eval, which had the side-effect
of attempting to append an OP_HINTSEVAL op twice. Formerly due to the way
the appending was done, the first OP_HINTSEVAL op was silently discarded;
after doing things "properly" with op_sibling_splice(), both ops ended up
being appended, and at run-time, the hints hash would be interpreted as
the SV to eval.

This wasn't tested in the core tests, and just ended up sometimes failing
warnings.t or Digest-SHA tests (but never on my system!)

9 years agominor fixups to new op_sibling work
David Mitchell [Tue, 1 Jul 2014 12:23:50 +0000 (13:23 +0100)]
minor fixups to new op_sibling work

remove pTHX args to op_parent() and op_sibling_splice() since they don't
use them, and cast an op type assignment. Also, minor fixups to the pod
for op_sibling_splice().

9 years agoImprove optree sanity checking code in finalize_op
David Mitchell [Mon, 30 Jun 2014 16:06:26 +0000 (17:06 +0100)]
Improve optree sanity checking code in finalize_op

The previous couple of commits added DEBUGGING code to finalize_op() that
checked, for BINOP/LISTOPs etc, that all the op's children had consistent
flags and that op_last pointed to the last op (and vice-versa under
PERL_OP_PARENT).  Extend most of this consistency checking to the various
classes of OP that have op_first but not op_last (like UNOP, LOGOP).

9 years agoadd op_lastsib and -DPERL_OP_PARENT
David Mitchell [Fri, 27 Jun 2014 10:52:44 +0000 (11:52 +0100)]
add op_lastsib and -DPERL_OP_PARENT

Add the boolean field op_lastsib to OPs. Within the core, this is set
on the last op in an op_sibling chain (so it is synonymous with op_sibling
being null). By default, its value is set but not used.

In addition, add a new build define (not yet enabled by default),
-DPERL_OP_PARENT, that forces the core to use op_lastsib to detect the
last op in a sibling chain, rather than op_sibling being NULL. This frees
up the last op_sibling pointer in the chain, which rather than being set
to NULL, is now set to point back to the parent of the sibling chain (if
any).

This commit also adds a C-level op_parent() function and B parent()
method; under default builds they just return NULL, under PERL_OP_PARENT
they return the parent of the current op.

Collectively this provides a facility not previously available from B:: nor
C, of being able to follow an op tree up as well as down.

9 years agoEnsure that op_last always points to last sibling
David Mitchell [Wed, 25 Jun 2014 17:09:14 +0000 (18:09 +0100)]
Ensure that op_last always points to last sibling

Add a big DEBUGGING-only check to S_finalize_op() that for list ops,
checks whether op_last points to the last sibling. Then fix up the places
where this isn't true.

It turns out that convert() and force_list() didn't update op_first, so
fix them. Also, the 'x' (repeat) op in list context is a binary op with
op_last set to null, which is a bit bizarre, but too complex to fix for
now. So just skip the test on that one.

9 years agoadd op_sibling_splice() fn and make core use it
David Mitchell [Mon, 16 Jun 2014 13:34:14 +0000 (14:34 +0100)]
add op_sibling_splice() fn and make core use it

The op_sibling_splice() is a new general-purpose OP manipulation
function designed to edit the children of an op, in an analogous
manner in which the perl splice() function manipulates arrays.

This commit also edits op.c and a few other places to remove most direct
manipulation of op_sibling, op_first and op_last, and replace that with
calls to op_sibling_splice().

This has two advantages. First, by using the one function consistently
throughout, it makes it clearer what a particular piece of of code is
doing, rather than having to decipher lots of of ad-hoc

    cLISTOPo->op_first = OP_SIBLING(kid);

style stuff. Second, it will make it easier to later add a facility for
child OPs to find their parent, since the changes now only need to be made
in a few places.

In theory this commit should make no functional change to the code.

9 years agoDevel::Peek: test 2-arg form of Dump
David Mitchell [Sat, 14 Jun 2014 12:10:46 +0000 (13:10 +0100)]
Devel::Peek: test 2-arg form of Dump

the 'Dump var, limit' form wasn't being tested.

9 years agomacroise op_sibling in Perl_ck_fun()
David Mitchell [Tue, 10 Jun 2014 15:34:16 +0000 (16:34 +0100)]
macroise op_sibling in Perl_ck_fun()

This is logically part of the previous commit, but since Perl_ck_fun()
took the address of o->op_sibling, it wasn't straightforward to simply
replace op_sibling with the relevant macros. So we now do it as a separate
commit.

It's basically trying to insert a new op into the sibling chain, and
depending on whether it inserts at the front or not, it updates
&cLISTOPo->op_first or &kid->op_sibling.

Rather than taking the address, make each assignment check whether the
destination is op_first or op_sibling. Slightly less elegant, but hey, it
works!

9 years agowrap op_sibling field access in OP_SIBLING* macros
David Mitchell [Tue, 10 Jun 2014 12:54:13 +0000 (13:54 +0100)]
wrap op_sibling field access in OP_SIBLING* macros

Remove (almost all) direct access to the op_sibling field of OP structs,
and use these three new macros instead:

    OP_SIBLING(o);
    OP_HAS_SIBLING(o);
    OP_SIBLING_set(o, new_value);

OP_HAS_SIBLING is intended to be a slightly more efficient version of
OP_SIBLING when only boolean context is needed.

For now these three macros are just defined in the obvious way:

    #define OP_SIBLING(o)          (0 + (o)->op_sibling)
    #define OP_HAS_SIBLING(o)      (cBOOL((o)->op_sibling))
    #define OP_SIBLING_set(o, sib) ((o)->op_sibling = (sib))

but abstracting them out will allow us shortly to make the last pointer in
an op_sibling chain point back to the parent rather than being null, with
a new flag indicating whether this is the last op.

Perl_ck_fun() still has a couple of direct uses of op_sibling, since it
takes the field's address, which is not covered by these macros.

9 years agolibperl.t + ASAN + -DPERL_GLOBAL_STRUCT_PRIVATE
David Mitchell [Tue, 8 Jul 2014 15:28:55 +0000 (16:28 +0100)]
libperl.t + ASAN + -DPERL_GLOBAL_STRUCT_PRIVATE

One of the t/porting/libperl.t tests was failing under
-DPERL_GLOBAL_STRUCT_PRIVATE with clang and address sanitizer,
since that combo added a data symbol to each object file:

    0000000000000000 d __unnamed_1

which contradicted the test of not having any global data.
Simply ignore that symbol for the purposes of the test.

9 years agofaster constant hash key lookups ($hash{const})
David Mitchell [Mon, 7 Jul 2014 22:17:13 +0000 (23:17 +0100)]
faster constant hash key lookups ($hash{const})

On something like $hash{constantstring}, at compile-time the
PVX string on the SV attached to the OP_CONST is converted into a
HEK (with an appropriate offset shift).

At run-time on hash keying, this HEK is used to speed up the bucket
search; however it turns out that this can be improved. Currently,
the main bucket loop does:

    for (; entry; entry = HeNEXT(entry)) {
if (HeHASH(entry) != hash)
    continue;
if (HeKLEN(entry) != (I32)klen)
    continue;
if (HeKEY(entry) != key && memNE(HeKEY(entry),key,klen))
    continue;
if ((HeKFLAGS(entry) ^ masked_flags) & HVhek_UTF8)
    continue;

The 'HeKEY(entry) != key' test is the bit that allows us to skip the
memNE() when 'key' is actually part of a HEK. However, this means that in
the const HEK scenario, for a match, we do pointless hash, klen and
HVhek_UTF8 tests, when HeKEY(entry) == key is sufficient for a
match. Conversely, in the non-const-HEK scenario, the 'HeKEY(entry) !=
key' will always fail, and so it's just dead weight in the loop.

To work around this, this commit splits the code into two separate bucket
search loops; one for const-HEKs that just compare HEK pointers, and a
general loop that now doesn't have do the 'HeKEY(entry) != key' test.

Analysing this code with cachegrind shows that with this commit, lookups
of constant keys that exist (e.g. the typical perl object scenario,
$self->{somefield}) takes 15% less instruction reads in hv_common(), 14%
less data reads and 27% less writes.

A lookup with a non-existing constant key ($hash{not_exist}) is about the
same as before (0.7% improvement).

Non-constant existing lookup ($hash{$existing_key}) is about 5% less
instructions, while $hash{$non_existing_key} is about 0.7%.

9 years agoAdd description to tests lacking them.
James E Keenan [Sat, 5 Jul 2014 01:13:55 +0000 (21:13 -0400)]
Add description to tests lacking them.

Explain why 'nomethod' special key is invoked.

9 years agoadd the standards of conduct to perlpolicy
Ricardo Signes [Mon, 7 Jul 2014 17:58:26 +0000 (13:58 -0400)]
add the standards of conduct to perlpolicy

9 years agoperldelta for e45636ee0875
Tony Cook [Mon, 7 Jul 2014 05:10:16 +0000 (15:10 +1000)]
perldelta for e45636ee0875

9 years agostatic misc things in /dist/threads/threads.xs
Daniel Dragan [Sun, 6 Jul 2014 06:59:02 +0000 (02:59 -0400)]
static misc things in /dist/threads/threads.xs

there is no reason for these functions to be exported on a linux build,
since they aren't exported on Win32, also consting ithread_vtbl allows
more memory to be shared between perl procs

9 years agoUpdate experimental to CPAN version 0.008
Chris 'BinGOs' Williams [Sun, 6 Jul 2014 10:52:41 +0000 (11:52 +0100)]
Update experimental to CPAN version 0.008

  [DELTA]

0.008     2014-07-05 13:58:28+02:00 Europe/Amsterdam
          Give better perl version formatting
          Fix smartmatch/switch description

9 years agoregcomp.c: Add assertion, remove case: statements
Karl Williamson [Mon, 12 May 2014 00:19:40 +0000 (18:19 -0600)]
regcomp.c: Add assertion, remove case: statements

This routine should never be called unless the new assertion is true,
which removes the need for the removed cases in the switch.

9 years agoUpdates to the HP-UX compilation warning.
Jarkko Hietaniemi [Sat, 5 Jul 2014 11:14:55 +0000 (07:14 -0400)]
Updates to the HP-UX compilation warning.

9 years agopod/perlre.pod: fix typo in example code
Aaron Crane [Sat, 5 Jul 2014 00:53:57 +0000 (01:53 +0100)]
pod/perlre.pod: fix typo in example code

9 years agoFilter::Simple: eliminate /\C/
David Mitchell [Fri, 4 Jul 2014 11:22:23 +0000 (12:22 +0100)]
Filter::Simple: eliminate /\C/

Since that construct is now deprecated, don't use it. It turns out that
it's usage was almost certainly wrong anyway, and a simple /./s is better.

It was temporarily converting literals within the src text to "$;NNNN$;"
where the Ns are 4 octets that encode the index of the literal.  It was
then using /(\C{4})/ to later extract those octets. But since the octets
were originally inserted as chars anyway, they should be extracted as
chars too.

I suspect the original code could have failed on utf8 source once the
number of literals exceeded 0x80.

9 years agoUpdate IO-Socket-IP to CPAN version 0.30
Chris 'BinGOs' Williams [Fri, 4 Jul 2014 09:11:37 +0000 (10:11 +0100)]
Update IO-Socket-IP to CPAN version 0.30

  [DELTA]

0.30    2014/07/03 23:28:43
        [CHANGES]
         * Invoke $self->connect fully-qualified in case of subclasses with
           override (RT95983)
         * Added extra diag() call in t/15io-socket.t (RT96914)

9 years agoDon't add unnecessary linespace.
James E Keenan [Fri, 4 Jul 2014 00:55:49 +0000 (20:55 -0400)]
Don't add unnecessary linespace.

And don't add trailing whitespace ever!  (Committer's error.)

9 years agoSupply description for only test lacking one.
James E Keenan [Fri, 4 Jul 2014 00:38:09 +0000 (20:38 -0400)]
Supply description for only test lacking one.

Wording of description taken from 'perlvar.pod' section on $EVAL_ERROR ($@).

9 years agoAvoid unused warnings from locale-less systems.
Jarkko Hietaniemi [Thu, 3 Jul 2014 15:33:22 +0000 (11:33 -0400)]
Avoid unused warnings from locale-less systems.

From Brian Fraser: "Technically, any Perl compiled with
-Accflags="-UUSE_LOCALE", or -Ui_locale -Ud_setlocale...
realistically, for Android".

9 years agoDeprecate /\C/
David Mitchell [Thu, 3 Jul 2014 15:08:56 +0000 (16:08 +0100)]
Deprecate /\C/

This character class matches a single byte within a multi-byte utf8 char,
and so breaks encapsulation. It is buggy, and can corrupt utf8 strings.

This deprecation was agreed in the thread starting

http://nntp.perl.org/group/perl.perl5.porters/210621

9 years agoUpdate Pod-Usage to CPAN version 1.64
Chris 'BinGOs' Williams [Thu, 3 Jul 2014 08:56:20 +0000 (09:56 +0100)]
Update Pod-Usage to CPAN version 1.64

  [DELTA]

1.64 (marekr)
- CPAN#93170: Abstract in pod doesn't follow convention
    fixed the NAME section
- CPAN#86932: documentation does not work with use strict
    rewritten parts of the DESCRIPTION section
- CPAN#86776: "pod2usage -verbose 2 FILE" is broken when perldoc is missing
    verified that pod2usage acts decently if perldoc is missing
    note: a Perl installation without perldoc is like a haunted house
    without ghosts

9 years agoSync Storable version for CPAN release
Chris 'BinGOs' Williams [Thu, 3 Jul 2014 08:54:20 +0000 (09:54 +0100)]
Sync Storable version for CPAN release

9 years agoperldelta for 3f7602fa4cd6
Tony Cook [Thu, 3 Jul 2014 06:33:00 +0000 (16:33 +1000)]
perldelta for 3f7602fa4cd6

9 years agoextra tests for grok_number(_flags)()
Tony Cook [Thu, 1 May 2014 05:37:08 +0000 (15:37 +1000)]
extra tests for grok_number(_flags)()

9 years ago[perl #3330] warn on increment of an non number/non-magically incable value
Tony Cook [Thu, 3 Jul 2014 05:09:32 +0000 (15:09 +1000)]
[perl #3330] warn on increment of an non number/non-magically incable value

The original version of this patch, introduced in
v5.19.2-389-g8140a7a, warned confusingly when incrementing strings
like "123abc".  This version includes the fix patch from [perl

9 years agouniversal.c gv_stashpv -> gv_stashpvs
Daniel Dragan [Wed, 2 Jul 2014 20:19:37 +0000 (16:19 -0400)]
universal.c gv_stashpv -> gv_stashpvs

avoids a strlen()

9 years agos///e on tainted utf8 strings got pos() messed up
David Mitchell [Wed, 2 Jul 2014 16:13:45 +0000 (17:13 +0100)]
s///e on tainted utf8 strings got pos() messed up

RT #122148: In 5.20, commit 25fdce4a165 changed the way pos() was stored
in magic attached to SVs from being a byte offset to a char offset,
*except* that, for efficiency, strings being used for pattern matching
were kept as byte offsets (with a flag indicating thus), *except* where
the SV already had magic attached (such as taint, as in the bug report and
in this commit's test), in which case it kept it as chars.

The code that updated pos() after an iteration of s///e was faulty: the
string buffer it used for converting byte legnths to char lengths (via
utf8_length()) was the wrong buffer: rather than using the src string
being matched against, it was using the destination string being built up
via iterations of s///. Once double-byte utf8 chars were involved, all the
pos() calculations went wrong, and utf8 warnings started mysteriously
appearing.

9 years agoEnable _FORTIFY_SOURCE only if optimizing, as specified.
Jarkko Hietaniemi [Wed, 2 Jul 2014 11:55:33 +0000 (07:55 -0400)]
Enable _FORTIFY_SOURCE only if optimizing, as specified.

As noticed by Dave Mitchell.

9 years agoUpdate ChangeLog before release
Abhijit Menon-Sen [Wed, 2 Jul 2014 11:00:40 +0000 (16:30 +0530)]
Update ChangeLog before release

9 years agopassthrough make options to make -s can speed up the build
Tony Cook [Wed, 2 Jul 2014 05:53:23 +0000 (15:53 +1000)]
passthrough make options to make -s can speed up the build

also quieten make_ext.pl by default

9 years agopass through -s if supplied, instead of defaulting to it
Tony Cook [Wed, 2 Jul 2014 05:50:02 +0000 (15:50 +1000)]
pass through -s if supplied, instead of defaulting to it

9 years agoallow the build to specify verbose make_ext.pl
Tony Cook [Wed, 2 Jul 2014 05:49:40 +0000 (15:49 +1000)]
allow the build to specify verbose make_ext.pl

9 years agoSupport faster make -s
Reini Urban [Fri, 25 Nov 2011 04:04:20 +0000 (22:04 -0600)]
Support faster make -s

Skip chdir messages by passing make -s through
Also silence make_ext.pl to speed up the build process. use -v or --verbose

9 years agoModule::CoreList::TieHashDelta stop massive recursion
Daniel Dragan [Wed, 28 May 2014 12:17:25 +0000 (08:17 -0400)]
Module::CoreList::TieHashDelta stop massive recursion

On machines with very limited memory, EXISTS calling EXISTS caused a very
high number of C stack frames, magic stack swaps, and Perl call stack
frames leading to memory exhaustion. Turn the recursion into a loop. See
[perl #121974].

9 years agoallow test.pl tests to use C<< plan skip_all => $reason >>
Tony Cook [Wed, 2 Jul 2014 00:30:07 +0000 (10:30 +1000)]
allow test.pl tests to use C<< plan skip_all => $reason >>

This pointless incompatibility with Test::More has resulted in
many annoyingly broken test scripts.

9 years agoavoid an undefined value warning from libperl.t
Tony Cook [Wed, 2 Jul 2014 00:05:33 +0000 (10:05 +1000)]
avoid an undefined value warning from libperl.t

and fix a doubly broken C<< plan skil_all => "no GNU nm"; >>

9 years agoperldelta for 5afb921fc188
Tony Cook [Tue, 1 Jul 2014 23:30:49 +0000 (09:30 +1000)]
perldelta for 5afb921fc188

9 years agoMake the "no name list" catcher more relaxed.
Jarkko Hietaniemi [Tue, 1 Jul 2014 12:58:30 +0000 (08:58 -0400)]
Make the "no name list" catcher more relaxed.

9 years agoIf building with DTrace, the dtrace header is required.
Peter Martini [Thu, 19 Dec 2013 10:21:19 +0000 (05:21 -0500)]
If building with DTrace, the dtrace header is required.

It's generated and its a dependency, so make depend seems like a natural
fit for it.

9 years agoSome more cppsymbols to scan.
Jarkko Hietaniemi [Sun, 29 Jun 2014 01:38:08 +0000 (21:38 -0400)]
Some more cppsymbols to scan.

Weirdly, BYTEORDER/BYTE_ORDER was missing.  Note that  __BYTE_ORDER__
might be '1234' even though longs are 64 bit, since probably the symbol
is used to tell the order in a "word", which still is "int", not "long".
In other words, Perl's BYTEORDER will likely be longer the the cppsymbol.

Gleaned some extra CPUs and OSes from
http://sourceforge.net/p/predef/wiki/Architectures/, though didn't go
all crazy on platforms with many variants like ARM, HPPA, SH.

9 years agoANSI prototypes for Berkeley DB API testing.
Jarkko Hietaniemi [Mon, 30 Jun 2014 01:10:02 +0000 (21:10 -0400)]
ANSI prototypes for Berkeley DB API testing.

So that g++ doesn't go apoplectic.  K&R prototypes in 2014?  Impressive.

9 years agoIn nonblock test do not ignore the syscall returns.
Jarkko Hietaniemi [Mon, 30 Jun 2014 01:02:47 +0000 (21:02 -0400)]
In nonblock test do not ignore the syscall returns.

Makes for less whining with warn_unused_result.

9 years ago-D_FORTIFY_SOURCE is no more a todo.
Jarkko Hietaniemi [Sat, 28 Jun 2014 22:24:23 +0000 (18:24 -0400)]
-D_FORTIFY_SOURCE is no more a todo.

9 years agoMention -D_FORTIFY_SOURCE in perldelta.
Jarkko Hietaniemi [Mon, 30 Jun 2014 13:03:49 +0000 (09:03 -0400)]
Mention -D_FORTIFY_SOURCE in perldelta.

9 years agoAdd -D_FORTIFY_SOURCE=2 when applicable.
Jarkko Hietaniemi [Sat, 28 Jun 2014 22:30:13 +0000 (18:30 -0400)]
Add -D_FORTIFY_SOURCE=2 when applicable.

Added only if available (gcc 4.*) and not already there.

Not already there might be explicit via ccflags, or less explicitly
via cppsymbols: for example in OS X 10.5+ the -D_FORTIFY_SOURCE=2
is already the default with the system cc (gcc earlier, now clang).

Some Linux distros (e.g. Fedora) also have enabled it for years,
either for all user code, or for their own builds.

9 years agoAssert before deref due to possible NULL.
Jarkko Hietaniemi [Sun, 29 Jun 2014 12:47:17 +0000 (08:47 -0400)]
Assert before deref due to possible NULL.

Coverity perl5 CID 68587.

9 years agoCoverity 45351 - Refactor to skip a loop iteration
Peter Martini [Mon, 2 Jun 2014 10:32:12 +0000 (06:32 -0400)]
Coverity 45351 - Refactor to skip a loop iteration

The loop in this case will remove an element from a list,
so it keeps a pointer to the previous element.  Before this
change, the pointer to the previous element was only initialized
at the end of the first pass, so Coverity flagged the code
as potentially using a NULL pointer.  It's a false positive
because the first element in the list is always a pushmark, so
the branch that actually used that pointer would never be hit
while it's still NULL, but changing the code to explicitly set
lasto before entering the loop (and asserting that its a PUSHMARK)
makes the logic clearer to both humans and Coverity.

9 years agoCosmetic consistency on "unimplemented function" deaths.
Jarkko Hietaniemi [Mon, 30 Jun 2014 02:03:45 +0000 (22:03 -0400)]
Cosmetic consistency on "unimplemented function" deaths.

9 years agolibperl.t: Allow tetss to pass if perl was compiled with -fno-common
Brian Fraser [Sun, 29 Jun 2014 13:16:45 +0000 (15:16 +0200)]
libperl.t: Allow tetss to pass if perl was compiled with -fno-common

If Perl was compiled with -fno-common, there will be no common
section in nm's output; the symbols we're looking for will be
under bss ('unknown').

9 years agoregcomp.c: Rewrite S_put_byte() which dumps regex []
Karl Williamson [Sat, 28 Jun 2014 21:12:45 +0000 (15:12 -0600)]
regcomp.c: Rewrite S_put_byte() which dumps regex []

This routine is used to display what the latin1 portions of a bracketed
character class matches.  It is what used, for example,  under -Dr to
display [] contents.  I noticed that the display had more hex characters
than needed, which are less intelligible than just printing out ASCII
printables.  And hence was harder to discern what is really going on.
This improves that, see the comments for more details.

9 years agotoke.c: White-space alignment, add comment
Karl Williamson [Sat, 28 Jun 2014 15:56:53 +0000 (09:56 -0600)]
toke.c: White-space alignment, add comment

9 years agopod/.gitignore: delete entries for now-unsupported arch-specific pods
Aaron Crane [Sat, 28 Jun 2014 17:54:02 +0000 (18:54 +0100)]
pod/.gitignore: delete entries for now-unsupported arch-specific pods

The build process creates a symlink pod/perl$platform.pod pointing to
README.$platform for each relevant platform, and we therefore want Git to
ignore those generated symlinks. Where we no longer support a given
platform, there's no need to have a gitignore entry for it.

9 years agoCapture the stderr of "nm libperl.a".
Jarkko Hietaniemi [Sat, 28 Jun 2014 18:05:41 +0000 (14:05 -0400)]
Capture the stderr of "nm libperl.a".

Ignore one known darwin seemingly harmless whine,
but die if otherwise unexpected stderr output.

Cannot do simply 2>&1 because buffering conflicts.

9 years agoskip works only with SKIP.
Jarkko Hietaniemi [Sat, 28 Jun 2014 02:10:16 +0000 (22:10 -0400)]
skip works only with SKIP.

Cannot do POSIX::blah() unless POSIX loaded ok.

(Makes freshly built "minitest" to pass again.)

9 years agoIncrement to $VERSION in ext/Hash-Util/lib/Hash/Util.pm.
James E Keenan [Sat, 28 Jun 2014 01:59:46 +0000 (03:59 +0200)]
Increment to $VERSION in ext/Hash-Util/lib/Hash/Util.pm.

Change to ext/Hash-Util/Util.xs requires this.

9 years agoFix like/is problem in perl5db.t.
Craig A. Berry [Fri, 27 Jun 2014 19:37:43 +0000 (14:37 -0500)]
Fix like/is problem in perl5db.t.

aaa63daea7f8ece changed like to is, which turned out not to be
quite the same thing for these tests on VMS, where the last line
of a file always gets a newline before EOF willy nilly.  So keep
is but make the newline explicit.

9 years agoGuard cur_curlyx at least with an assert.
Jarkko Hietaniemi [Sat, 28 Jun 2014 00:15:26 +0000 (20:15 -0400)]
Guard cur_curlyx at least with an assert.

Keep on keeping Coverity happy (Coverity perl5 CID 45352).

9 years agohv can be left uninitialized.
Jarkko Hietaniemi [Fri, 27 Jun 2014 23:47:32 +0000 (19:47 -0400)]
hv can be left uninitialized.

Stronger statement would be assert(), even stronger croak(),
but don't know the code well enough.

Coverity perl5 CIDs 68584 and 68585.

9 years agoprintf formats are hard.
Jarkko Hietaniemi [Fri, 27 Jun 2014 23:43:44 +0000 (19:43 -0400)]
printf formats are hard.

Coverity perl5 CID 68582.

9 years agoassert(*p = '#'); /* Spot the oops. */
Jarkko Hietaniemi [Fri, 27 Jun 2014 23:35:31 +0000 (19:35 -0400)]
assert(*p = '#');  /* Spot the oops. */

Triggered new Coverity perl5 CIDs 68580, 68581 and 68583.
(Side effect in assertion, and assignment where comparison
probably indented, the last twice because of ext/re.)

9 years agoTime functions in time64.c need thread context on VMS.
Craig A. Berry [Fri, 27 Jun 2014 12:58:42 +0000 (07:58 -0500)]
Time functions in time64.c need thread context on VMS.

In order to support the C<vmsish 'time'> pragma, the wrappers for
gmtime and localtime need thread context, which in the case of
localtime was removed in 23491f1decae17401c5.  Add it back but
make it VMS-specific and turn the comment indicating why it's
there into a more direct statement.

9 years agoregexec.c: Move some macro definitions around
Karl Williamson [Thu, 26 Jun 2014 19:09:25 +0000 (13:09 -0600)]
regexec.c: Move some macro definitions around

This puts them in a more logical order

9 years agoPATCH: [perl #122090] Non-word-boundary doesn't match EOS
Karl Williamson [Mon, 23 Jun 2014 01:52:59 +0000 (19:52 -0600)]
PATCH: [perl #122090] Non-word-boundary doesn't match EOS

The root cause of this is that the loop is a "< strend" instead of a
"<=".  However, the macro that is called to form the loop is used
elsewhere where "<" is appropriate.  So I opted to just repeat the
small salient portions of the loop right after it so it gets executed
one final time in the final position.

This code:
 if ((!prog->minlen && tmp) && (reginfo->intuit || regtry(reginfo, &s))) \
           goto got_it;
had the effect previously of causing \b to look at the position just
after the string, but not \B.  By doing it the other way, this is no
longer needed, except I don't understand the prog->minlen portion.  It
isn't used anywhere else in the tests which see if one should goto
got_it, nor do any test suite tests fail by removing it.  I think it is
a relic, but if a bisect should end up blaming this commit, I'd start
with that.

9 years agoregexec.c: Comments and white-space only
Karl Williamson [Mon, 23 Jun 2014 01:51:11 +0000 (19:51 -0600)]
regexec.c: Comments and white-space only

9 years agoregexec.c: Exchange 2 lines of code and add comments
Karl Williamson [Mon, 23 Jun 2014 01:48:23 +0000 (19:48 -0600)]
regexec.c: Exchange 2 lines of code and add comments

This reorders things to avoid unnecessary work, as the now-first line
may jump, making the assignment that used to be unconditional irrelevant

9 years agoregexec.c: More cleaning of FBC macro/code interface
Karl Williamson [Mon, 23 Jun 2014 01:41:25 +0000 (19:41 -0600)]
regexec.c: More cleaning of FBC macro/code interface

The definition of \w is now compiled into the Perl core.  This allows
the complicated swash_fetch function call to be replaced by
isWORDCHAR_utf8, which takes a single parameter, so the interface can be
simplified. [1].

This macro will execute faster on Latin1-range inputs, as it doesn't do
a swash_fetch on them, but slower on other code points due to function
call overhead, and some currently in-place error checking that wasn't
done previously.  This overhead could be removed by using inline
functions, and perhaps a different interface for known non-malformed
input (though I'm actually not sure the input is known to be well-formed
in this case).

These macros still depend on and modify outside variables.  That could
be cleaned up by adding additional parameters to them, but I'm not going
to do it now.  I don't like these kinds of code-generating macros, and
have been tempted to rewrite these as inline functions, but it's not a
trivial task to do.

[1] I hadn't realized it before, but the interface could have been
cleaned up instead by introducting a macro that makes it look like a
single parameter is used uniformly to existing macros, looking like
 #define FBC_BOUND_SWASH_FETCH(s)  \
    cBOOL(swash_fetch(PL_utf8_swash_ptrs[_CC_WORDCHAR], s, utf8_target))
But it seems better to me to use isWORDCHAR_utf8 as it is faster for
Western European languages, and can be made nearly the same speed as the
alternative if experience tells us that this is a slow spot that should
be sped up.

9 years agoregexec.c: Clean up macro/code interface slightly
Karl Williamson [Mon, 23 Jun 2014 01:13:10 +0000 (19:13 -0600)]
regexec.c: Clean up macro/code interface slightly

These code-generating macros are a pain to maintain.  These have side
effects and use variables outside the macros.  This commit cleans up the
interface slightly by separating the operand of a function from the
function, so the code outside doesn't have to know as much about the
macro as before.  The next commit will fix up the remaining parameter
like this.

9 years agoregexec.c: Change names of 4 macros
Karl Williamson [Mon, 23 Jun 2014 00:58:39 +0000 (18:58 -0600)]
regexec.c: Change names of 4 macros

The names were misleading; they were not for general use, but only for
this FBC area of the code, and they no longer have to do with having to
load utf8 or not.

9 years agoregexec.c: Change MiXeD cAsE formal macro parameters
Karl Williamson [Sun, 22 Jun 2014 03:53:03 +0000 (21:53 -0600)]
regexec.c: Change MiXeD cAsE formal macro parameters

I find these a pain to type and read, and there is no reason for them.
As formal parameters there is no possibility of conflict with the code
outside them.  And I'm about to do some editing of these, so this change
will make that easier.

9 years agoSync Module-CoreList version in Maintainers.pl for CPAN release
Chris 'BinGOs' Williams [Thu, 26 Jun 2014 09:13:38 +0000 (10:13 +0100)]
Sync Module-CoreList version in Maintainers.pl for CPAN release

9 years agoFollow-up to 51f14a05: not ignoring my_snprintf return values.
Jarkko Hietaniemi [Wed, 25 Jun 2014 19:44:49 +0000 (15:44 -0400)]
Follow-up to 51f14a05: not ignoring my_snprintf return values.

9 years agoGlossary for d_ptrdiff_t
Brian Fraser [Wed, 25 Jun 2014 13:30:37 +0000 (15:30 +0200)]
Glossary for d_ptrdiff_t

9 years agoAdd a small test case for c445c5b
Matthew Horsfall [Wed, 25 Jun 2014 14:31:20 +0000 (10:31 -0400)]
Add a small test case for c445c5b

9 years agoAdd t/porting/libperl.t
Jarkko Hietaniemi [Mon, 23 Jun 2014 18:11:50 +0000 (14:11 -0400)]
Add t/porting/libperl.t

For sanity checking libperl.a on those platforms that have one,
and extra checking for the rare configurations of -DPERL_GLOBAL_STRUCT
and -DPERL_GLOBAL_STRUCT_PRIVATE which restructure the symbol exports.

9 years agoRemove or downgrade unnecessary dVAR.
Jarkko Hietaniemi [Mon, 23 Jun 2014 11:01:34 +0000 (07:01 -0400)]
Remove or downgrade unnecessary dVAR.

You need to configure with g++ *and* -Accflags=-DPERL_GLOBAL_STRUCT
or -Accflags=-DPERL_GLOBAL_STRUCT_PRIVATE to see any difference.
(g++ does not do the "post-annotation" form of "unused".)

The version code has some of these issues, reported upstream.

9 years agoUnused snprintf results noticed by clang in Linux.
Jarkko Hietaniemi [Tue, 24 Jun 2014 22:08:58 +0000 (18:08 -0400)]
Unused snprintf results noticed by clang in Linux.

A bit dubious to ignore the snprintf results, but at least
for these cases it looks acceptable.  We could assign the
length and croak if not expected, but it seems that with
gcc brace groups we already do that.

9 years agoFix RT #122171, lookahead issues with .*
Yves Orton [Wed, 25 Jun 2014 07:27:02 +0000 (09:27 +0200)]
Fix RT #122171, lookahead issues with .*

Patterns of the form /(?=.*X)X/ were getting the IMPLICIT flag set,
which does not work with lookahead.

This used to not be a problem as we did not look at the contents of
lookahead patterns in the start-class optimizer. In 07be1b83a6b2d24
I changed this, and this case would break. That it took this long
to come to light is probably because the pattern does not really make
sense.

https://rt.perl.org/Public/Bug/Display.html?id=122171

9 years agoperldelta for 0f9d28587772, cd293174fae5
Tony Cook [Wed, 25 Jun 2014 05:13:53 +0000 (15:13 +1000)]
perldelta for 0f9d28587772cd293174fae5

9 years agobump dist/Math-BigInt/ $VERSIONS to 1.9996
Tony Cook [Wed, 25 Jun 2014 04:53:50 +0000 (14:53 +1000)]
bump dist/Math-BigInt/ $VERSIONS to 1.9996

9 years agoCPAN RT 96254 and 96329: Correct the handling of subclasses.
Peter John Acklam [Sun, 15 Jun 2014 16:46:52 +0000 (18:46 +0200)]
CPAN RT 96254 and 96329: Correct the handling of subclasses.

Don't check for an exact class name; trust inheritance.

9 years agobump $XS::APItest::VERSION to 0.62
Matthew Horsfall (alh) [Wed, 25 Jun 2014 02:20:37 +0000 (22:20 -0400)]
bump $XS::APItest::VERSION to 0.62

9 years agoUnder GLOBAL_STRUCT mgvtbl-s are const, which angers g++.
Jarkko Hietaniemi [Tue, 24 Jun 2014 22:57:19 +0000 (18:57 -0400)]
Under GLOBAL_STRUCT mgvtbl-s are const, which angers g++.

See also 31114fe99.

9 years agoUnused contexts found under PERL_GLOBAL_STRUCT.
Jarkko Hietaniemi [Mon, 23 Jun 2014 11:01:34 +0000 (07:01 -0400)]
Unused contexts found under PERL_GLOBAL_STRUCT.

9 years agoDrop debugging, and handle HP-UX opt flags.
Jarkko Hietaniemi [Tue, 24 Jun 2014 14:28:05 +0000 (10:28 -0400)]
Drop debugging, and handle HP-UX opt flags.

9 years agoFurther hpux hints simplifying suggested by H.Merijn.
Jarkko Hietaniemi [Tue, 24 Jun 2014 13:12:48 +0000 (09:12 -0400)]
Further hpux hints simplifying suggested by H.Merijn.