platform/upstream/perl.git
10 years agore_intuit_start(): update comments in BmUSEFUL blk
David Mitchell [Sun, 16 Mar 2014 12:17:18 +0000 (12:17 +0000)]
re_intuit_start(): update comments in BmUSEFUL blk

10 years agore_intuit_start(): update comments in stclass code
David Mitchell [Sun, 16 Mar 2014 11:58:51 +0000 (11:58 +0000)]
re_intuit_start(): update comments in stclass code

Improve the description at the start of this code block, and move
some of the comments closer to where they apply (and explain why they're
probably wrong)

10 years agore_intuit_start(): improve main terminating cond
David Mitchell [Sun, 16 Mar 2014 11:36:43 +0000 (11:36 +0000)]
re_intuit_start(): improve main terminating cond

At the end of the failure block in the stclass code, it decides whether
rx_origin has been advanced too much for the match to ever succeed, and if
so, quits.

That test has a comment next to it about perhaps testing for this earlier.
It also does a byte rather than chars calculation.

This commit does the following.

It adds a proper chars-based termination test near the beginning of the
'check' code block. This test is essentially free, since at that point
we've just done the necessary HOPs. It also calculates start_point using
end_point rather the strend as the limit, so avoiding a bit of unnecessary
hopping when we're about to fail anyway. It introduces the new HOPMAYBE3
macro wrapper for this purpose.

It keeps the old bytes-based test at the end in stclass, with a note that
the simple bytes calculation errs on the side of re-entering the check
block where the accurate chars-based test is now done.

10 years agore_intuit_start(): update stclass code comments
David Mitchell [Sat, 15 Mar 2014 15:08:46 +0000 (15:08 +0000)]
re_intuit_start(): update stclass code comments

Document instances where its safe to use bytes verses char length
arithmetic, and generally improve some of the commentary in this block of
code.

10 years agore_intuit_start(): remove an obsolete assert.
David Mitchell [Sat, 15 Mar 2014 15:00:48 +0000 (15:00 +0000)]
re_intuit_start(): remove an obsolete assert.

I added the assert a while ago while I was refactoring this code. It's
pretty obvious now that at this point, rx_origin > strpos.  (It wasn't
back then, as strpos wasn't constant).

10 years agore_intuit_start(): fix byte/char calculation err
David Mitchell [Sat, 15 Mar 2014 14:27:47 +0000 (14:27 +0000)]
re_intuit_start(): fix byte/char calculation err

On failure to find stclass in float range, it currently does:

    rx_origin = check_at - start_shift;

which should instead be

    rx_origin = HOP3c(check_at, - start_shift, strbeg);

The second added test is an example of when this causes a false negative.
(The first test is just the analogue without a UTF8 string, so it already
passes).

Since we actually already calculate this value earlier as part of
determining endpos in the float case, assign the result of that calc to a
local var, then just reuse it.

10 years agore_intuit_start(): eliminate checked_upto var
David Mitchell [Mon, 10 Mar 2014 17:53:48 +0000 (17:53 +0000)]
re_intuit_start(): eliminate checked_upto var

This var is supposed to record the latest place that stclass
had rejected, so if we try again, we don't start any earlier than that.
However, an assert showed that nothing in the test suite ever left
checked_upto > rx_origin on re-entry, so we could always use rx_origin
directly.

On failure, checked_upto is reset to HOPBACKc(endpos, start_shift)
where endpoint is the highest char that find_byclass() was asked to search
to. Now, I think that this is a logical error; it should have been
HOPBACKc(endpos, cl_l) or similar; i.e. just hop back the number of chars
equal to the length of the character class; using start_shift just makes
checked_upto artificially too small.

But in either case, consider the following more formal analysis (the
arithmetic below is in terms of chars).

Assume initially at least, that checked_upto <= rx_origin. The question is
whether we can ever end up with checked_upto "overtaking" rx_origin.

Where there is an anchored substring or ml_anch, we have:

    endpos = r_origin + cl_l;
    on failure,
        checked_upto = endpos - (start_shift or cl_l)

    since start_shift should be => cl_l, in either case we end up with
    checked_upto <= rx_origin.

Where there is only a floating substring, we have:

    endpos = r_origin - start_shift + cl_l;
    on failure,
        checked_upto = endpos - (start_shift or cl_l)

    again, since start_shift should be => cl_l, in either case we end up with
    checked_upto <= rx_origin.

Where there are no substrings, we return on failure; so the updating
checked_upto is irrelevant.

On success we return, so again the updating of checked_upto is irrelevant.

10 years agore_intuit_start(): fix a comment about overlap
David Mitchell [Mon, 10 Mar 2014 15:48:25 +0000 (15:48 +0000)]
re_intuit_start(): fix a comment about overlap

The comment said that we don't allow the anchored and floating substrings
to overlap. This is trivially wrong, e.g.

/aa+/ has an anchored of "aa" at 0 and a float of "a at 1..inf

Fix the comment to say what the assertion actually already tests for, i.e.
that the float doesn't start before the anchored.

10 years agore_intuit_start(): trivial reorg of stclass code
David Mitchell [Sat, 8 Mar 2014 17:29:43 +0000 (17:29 +0000)]
re_intuit_start(): trivial reorg of stclass code

make all the actions on success follow the actions on failure,
rather than being partly before and partly after.

No functional changes.

10 years agore_intuit_start(): always initialise start_shift
David Mitchell [Sat, 8 Mar 2014 14:38:56 +0000 (14:38 +0000)]
re_intuit_start(): always initialise start_shift

The start_shift variable is usually initialised to prog->check_offset_min,
except for one code path where it is left at zero. It turns out that
in that code path, the value isn't (currently) used, so is safe. However,
that may change, so unconditionally initialise it.

10 years agore_intuit_start(): swap BmUSEFUL + stclass blocks
David Mitchell [Tue, 18 Feb 2014 10:13:54 +0000 (10:13 +0000)]
re_intuit_start(): swap BmUSEFUL + stclass blocks

Currently the code that does BmUSEFUL()--, and which and frees the
substring if the count reaches zero, comes before the stclass code. This
is problematic, because by the time the stclass code is executed, the
check substrings may have been freed. The stclass code does have some
checks for this, but they are inadequate: I managed to produce code that
segfaulted. It's also hard to test - you have to run against the same
pattern 100 times to get the BmUSEFUL() count down to zero, then on the
101st attempt, do something that both triggers the decrement/free and
fails the st class.

By moving the BmUSEFUL()-- stuff to *after* the stclass code, it removes
this issue completely.

As to how it affects the BmUSEFUL() count: I think it makes it slightly
better. Before, a substring could match at rx_origin offset 0, triggering
BmUSEFUL()--, then the stclass could fail, triggering a new substring
match at at a non-zero offset, and thus doing BmUSEFUL()++. The overall
affect being neutral. Now, the overall effect is BmUSEFUL += 1, which
better reflects the fact that the substring *did* help us find a non-zero
offset.

10 years agore_intuit_start(): de-duplicate condition
David Mitchell [Mon, 17 Feb 2014 20:46:15 +0000 (20:46 +0000)]
re_intuit_start(): de-duplicate condition

Change

    if (have_anchored && check_ix == 1) {
        B;
    }

    if (!have_anchored) {
        A;
    }

    C;

To:

    if (have_anchored) {
        if (check_ix == 1) {
            B;
        }
    }
    else {
        A;
    }

    C;

This change should be functionally equivalent, but eliminates calculating
the have_anchored condition twice.

10 years agore_intuit_start(): swap two blocks, delete label
David Mitchell [Mon, 17 Feb 2014 20:37:13 +0000 (20:37 +0000)]
re_intuit_start(): swap two blocks, delete label

Change

    if (!have_anchored) {
        A;
        goto hop_and_restart;
    }

    if (check_ix == 1) {
        B;
    }

  hop_and_restart:
    C;

To:

    if (have_anchored && check_ix == 1) {
        B;
    }

    if (!have_anchored) {
        A;
    }

    C;

This change should be functionally equivalent, but eliminates a label.

10 years agore_intuit_start(): swap another if/else block
David Mitchell [Mon, 17 Feb 2014 20:20:40 +0000 (20:20 +0000)]
re_intuit_start(): swap another if/else block

Change

    {
        ...
        if (has_anchored) {
            A;
            goto restart;
        }
        B;
        goto hop_and_restart;
    }

to

    {
        ...
        if (!has_anchored) {
            B;
            goto hop_and_restart;
        }
        A;
        goto restart;
    }

Functionally the same, but will allow simpler code shortly

10 years agore_intuit_start(): remove redundant assertion
David Mitchell [Mon, 17 Feb 2014 20:12:31 +0000 (20:12 +0000)]
re_intuit_start(): remove redundant assertion

assert(prog->substrs->check_ix) is within the block
    if (prog->substrs->check_ix == 1)
so it's not needed any more.

10 years agore_intuit_start(): swap another if/else block
David Mitchell [Mon, 17 Feb 2014 19:45:12 +0000 (19:45 +0000)]
re_intuit_start(): swap another if/else block

Change

    {
        if (cond)
            goto x;
        A;
        goto y;
    }
    x:

into

    {
        if (!cond) {
            A;
            goto y;
        }
    }
    x:

Functionally equivalent, but eliminates one 'goto'.

10 years agore_intuit_start(): swap if/else blocks
David Mitchell [Mon, 17 Feb 2014 19:39:44 +0000 (19:39 +0000)]
re_intuit_start(): swap if/else blocks

Change

    {
        if (cond) {
            A;
            goto x;
        }
        B;
        goto y;
    }

into
    {
        if (!cond) {
            B;
            goto y;
        }
        A;
        goto x;
    }

Should be functionally equivalent, but will allow for some further code
factorisation shortly.

10 years agore_intuit_start(): eliminate one label
David Mitchell [Mon, 17 Feb 2014 19:07:08 +0000 (19:07 +0000)]
re_intuit_start(): eliminate one label

Currently the code looks like:

    if (rx_origin + start_shift >= check_at)
        goto retry_floating_check;

    ....

  retry_floating_check:
    rx_origin = check_at - start_shift;
    goto hop_and_restart;

But that conditional only kicks in when the floating substring (which was
the check substring) matched, so this condition always applies:

    rx_origin + start_shift <= check_at

So the condition in the code will only ever be true when

    rx_origin + start_shift == check_at

In this case, this assignment is a noop:

    rx_origin = check_at - start_shift;

So skip it and jump directly to hop_and_restart. This eliminates the
retry_floating_check: label.

10 years agoadd test for a code path in intuit_start()
David Mitchell [Mon, 17 Feb 2014 18:51:48 +0000 (18:51 +0000)]
add test for a code path in intuit_start()

Nothing in the test suite currently triggers *not* taking this branch:

    /* Have both, check_string is floating */
    if (rx_origin + start_shift >= check_at) /* Contradicts floating=check */

So add something that does trigger it.

10 years agore_intuit_start(): eliminate debug-only var
David Mitchell [Mon, 10 Feb 2014 19:56:08 +0000 (19:56 +0000)]
re_intuit_start(): eliminate debug-only var

'what' is only defined and assigned to in debugging builds.
Just calculate the value on the fly instead when printing debugging
output. Makes the code less messy.

10 years agore_intuit_start(): eliminate t from stclass code
David Mitchell [Mon, 10 Feb 2014 15:37:30 +0000 (15:37 +0000)]
re_intuit_start(): eliminate t from stclass code

The 't' variable now just contains a copy of rx_origin; so just use
rx_origin directly, and eliminate t.

10 years agore_intuit_start(): reduce use of s in stclass code
David Mitchell [Mon, 10 Feb 2014 14:52:46 +0000 (14:52 +0000)]
re_intuit_start(): reduce use of s in stclass code

s is mainly acting as a stand-in for rx_origin; so just use rx_origin
directly.

10 years agore_intuit_start(): remove if(check)
David Mitchell [Mon, 10 Feb 2014 14:44:25 +0000 (14:44 +0000)]
re_intuit_start(): remove if(check)

It this point in the stclass block, we have already confirmed that an
anchored substring exists and that the check substring is anchored.
So check cannot be null at this point. So don't test for it being null.

10 years agore_intuit_start(): use check_ix for efficiency
David Mitchell [Mon, 10 Feb 2014 13:28:25 +0000 (13:28 +0000)]
re_intuit_start(): use check_ix for efficiency

10 years agore_intuit_start(): stclass: use rx_origin more
David Mitchell [Mon, 10 Feb 2014 13:23:07 +0000 (13:23 +0000)]
re_intuit_start(): stclass: use rx_origin more

In the stclass code block, we do

    s = rx_origin;
    ... stuff reading the value of s ...
    s = find_byclass(...);

change that to

    ... stuff reading the value of rx_origin ...
    s = find_byclass(...);

10 years agoOn OS X, allow Configure to override $ld with -Dld=...
Nicholas Clark [Sun, 16 Mar 2014 15:18:09 +0000 (16:18 +0100)]
On OS X, allow Configure to override $ld with -Dld=...

Since it was added, hints/darwin.sh had been ignoring any user configuration
options and unconditionally setting ld='cc'. Instead, it should take a user
supplied value if one is given, otherwise defaulting to 'cc'.

The strange thing is that this was never noticed when commits cb3fc4263509f28c
and 69625aa92a91bf4c (May 2003) which added code which was intended offer
alternative behaviour if ld contained MACOSX_DEVELOPMENT_TARGET.

10 years agoConfigure misdetects strlcpy et al. with gcc -flto (RT#113022)
H.Merijn Brand [Sun, 16 Mar 2014 08:59:44 +0000 (09:59 +0100)]
Configure misdetects strlcpy et al. with gcc -flto (RT#113022)

10 years agoUpdate perldelta for core changes to this point
Aaron Crane [Sat, 15 Mar 2014 16:35:56 +0000 (16:35 +0000)]
Update perldelta for core changes to this point

This doesn't include module version updates.

10 years agoWhite-space only; properly indent newly formed blocks
Karl Williamson [Fri, 14 Mar 2014 20:51:50 +0000 (14:51 -0600)]
White-space only; properly indent newly formed blocks

The previous commit added braces forming blocks.  This indents the
contents of those blocks.

10 years agomktables: Inline short tables
Karl Williamson [Fri, 14 Mar 2014 20:23:21 +0000 (14:23 -0600)]
mktables: Inline short tables

mktables generates tables of Unicode properties.  These are stored in
files to be loaded on-demand.  This is because the memory cost of having
all of them loaded would be excessive, and many are rarely used.  Hashes
are created in Heavy.pl which is read in by utf8_heavy.pl map the
Unicode property name to the file which contains its definition.

It turns out that nearly half of current Unicode properties are just a
single consecutive ranges of code points, and their definitions are
representable almost as compactly as the name of the files that contain
them.

This commit changes mktables so that the tables for single-range
properties are not written out to disk, but instead a special syntax is
used in Heavy.pl to indicate this and what their definitions are.

This does not increase the memory usage of Heavy.pl appreciably, as the
definitions replace the file names that are already there, but it lowers
the number of files generated by mktables from 908 (in Unicode 6.3) to
507.  These files are probably each a disk block, so the disk savings is
not large.  But it means that reading in any of these properties is much
faster, as once utf8_heavy gets loaded, no further disk access is needed
to get any of these properties.  Most of these properties are obscure,
but not all.  The Line and Paragraph separators, for example, are quite
commonly used.

Further, utf8_heavy.pl caches the files it has read in into hashes.
This is not necessary for these, as they are already in memory, so the
total memory usage goes down if a program uses any of these, but again,
since these are small, that amount is not large..  The major gain is not
having to read these files from disk at run time.

Tables that match no code points at all are also represented using this
mechanimsm.  Previously, they were expressed as the complements of
\p{All}, which matches everything possible.

10 years agolib/locale.t: Update $variable name
Karl Williamson [Wed, 12 Mar 2014 19:06:49 +0000 (13:06 -0600)]
lib/locale.t: Update $variable name

As of commit b057411ddb1a3d8b6ab062d667c8e39f80cd7343, the meaning of
the variable is extended to beyond just being about 'folding', so change
the name to correspond.

10 years agoPATCH: [perl #121340] lib/locale.t noisy+complaining but passes on Win32
Karl Williamson [Wed, 12 Mar 2014 19:03:22 +0000 (13:03 -0600)]
PATCH: [perl #121340] lib/locale.t noisy+complaining but passes on Win32

It turns out that these messages were not printed as one would expect
under TAP, but were output using warn().

10 years agolib/locale.t: Fix broken test
Karl Williamson [Wed, 12 Mar 2014 18:54:45 +0000 (12:54 -0600)]
lib/locale.t: Fix broken test

The test that [:digit:] is a subset of [:xdigit:] failed in locales
where  [:digit:] matches 2 blocks of 10 digits, but the second block
isn't considered part of [:xdigit:].  This happens in Thai on Windows.
The POSIX standard http://pubs.opengroup.org/onlinepubs/9699919799/
does not use very clear language, but I'm taking it as meaning it is ok
for this to happen, so this revises the test to accept it.

10 years agoUpdate ExtUtils-MakeMaker to CPAN version 6.92
Chris 'BinGOs' Williams [Thu, 13 Mar 2014 16:40:50 +0000 (16:40 +0000)]
Update ExtUtils-MakeMaker to CPAN version 6.92

  [DELTA]

6.92 Thu Mar 13 16:18:32 GMT 2014

    No changes from 6.91_01

6.91_01 Thu Mar  6 13:48:22 GMT 2014
    Test fixes:
    * Make meta tests more robust to changes in CPAN::Meta

10 years agoUpgrade to Thread::Queue 3.04
Jerry D. Hedden [Tue, 11 Mar 2014 19:31:24 +0000 (15:31 -0400)]
Upgrade to Thread::Queue 3.04

10 years agoregcomp.c: Don't read past string-end
Karl Williamson [Wed, 12 Mar 2014 20:11:58 +0000 (14:11 -0600)]
regcomp.c: Don't read past string-end

In doing an audit of regcomp.c, and experimenting using
Encode::_utf8_on(), I found this one instance of a regen/regcharclass.pl
macro that could read beyond the end of the string if given malformed
UTF-8.  Hence we convert to use the 'safe' form.  There are no other
uses of the non-safe version, so don't need to generate them.

10 years agosprinkle LIKELY() on pp_hot.c scope.c and some *.h
David Mitchell [Wed, 12 Mar 2014 19:14:13 +0000 (19:14 +0000)]
sprinkle LIKELY() on pp_hot.c scope.c and some *.h

I've gone through pp_hot.c and scope.c and added LIKELY() or UNLIKELY()
to all conditionals where I understand the code well enough to know that
a particular branch is or isn't likely to be taken very often.

I also processed some of the .h files which contain commonly used macros.

10 years agoregcomp.c: Make SSC node clone safe
Karl Williamson [Wed, 12 Mar 2014 19:15:44 +0000 (13:15 -0600)]
regcomp.c: Make SSC node clone safe

This just sets the ptr field in the Synthetic Start Class that will be
passed to regexec.c NULL, and clarifies the comments in regcomp.h.  See
the thread starting at http://markmail.org/message/2txwaqnjco6zodeo

10 years agoregen/regcharclass.pl: Don't generate unused macros
Karl Williamson [Tue, 11 Mar 2014 21:58:54 +0000 (15:58 -0600)]
regen/regcharclass.pl: Don't generate unused macros

Having these unused macros around just clutters up the header file

10 years agoregen/regcharclass.pl: Generate correct macro instead of skipping
Karl Williamson [Tue, 11 Mar 2014 21:47:53 +0000 (15:47 -0600)]
regen/regcharclass.pl: Generate correct macro instead of skipping

It makes no sense to check for length safeness for The macros generated
by this program which take a single UV code point as a parameter. Prior
to this patch, it would skip trying to generate them if asked.  But,
because of the way things are structured, that means that if you need
just this and the safe versions, you can't do it so easily.  What this
commit does is generate the cp macro if requested even if the 'safe'
version of other macros are also requested.

10 years agoUpdate ExtUtils-Install Changes file
Chris 'BinGOs' Williams [Wed, 12 Mar 2014 12:21:04 +0000 (12:21 +0000)]
Update ExtUtils-Install Changes file

10 years agoMake the ExtUtils-Install tests parallelisable
Chris 'BinGOs' Williams [Wed, 12 Mar 2014 11:55:48 +0000 (11:55 +0000)]
Make the ExtUtils-Install tests parallelisable

10 years agoBackport/genererate work from cross-port
H.Merijn Brand [Wed, 12 Mar 2014 10:00:00 +0000 (11:00 +0100)]
Backport/genererate work from cross-port

At the "Perl5 and beyond" hackathon early feb 2014 in Amsterdam, hugmeir
and I walked through all the changes and ended up with a serious warning
in metalint where we stopped. The warning proved to be a bug in metalint
that will be fixed in the future and has a rather easy workaround.

Porting/Glossary is not yet being generated correctly. Will take care of
that later.

10 years agoperlfunc: layout getpw*&c return values as a table
Aristotle Pagaltzis [Tue, 11 Mar 2014 12:58:19 +0000 (13:58 +0100)]
perlfunc: layout getpw*&c return values as a table

10 years agoperldiag: Clarify that lexicals do not trigger "used only once"
Aristotle Pagaltzis [Tue, 11 Mar 2014 00:57:19 +0000 (01:57 +0100)]
perldiag: Clarify that lexicals do not trigger "used only once"

10 years agoExtUtils-Install-1.62 has been released to CPAN
Chris 'BinGOs' Williams [Mon, 10 Mar 2014 15:25:22 +0000 (15:25 +0000)]
ExtUtils-Install-1.62 has been released to CPAN

10 years agoremove a redundant SvTIED_mg from S_do_smartmatch
Daniel Dragan [Mon, 10 Mar 2014 14:03:09 +0000 (14:03 +0000)]
remove a redundant SvTIED_mg from S_do_smartmatch

A non tied HV potentially could be checked twice for being tied. Move
HvUSEDKEYS part to avoid checking var tied twice. The redundant tied check
comes from day 1 of smart match in commit 0d863452f5 . IDK why HV sides
are swapped, but comment it.

10 years agodon't repeatedly call HvUSEDKEYS
Daniel Dragan [Mon, 10 Mar 2014 12:29:56 +0000 (12:29 +0000)]
don't repeatedly call HvUSEDKEYS

HvUSEDKEYS contains a function call nowadays. Don't call it repeatedly.

10 years agoHandle "no versions" feature in fileify and tovmsspec.
Craig A. Berry [Sun, 9 Mar 2014 00:35:49 +0000 (18:35 -0600)]
Handle "no versions" feature in fileify and tovmsspec.

This is a follow-up to d5e61aaf9d7051b136, where we stopped
escaping semicolons in tovmsspec when they appeared to be the
beginning of a version specification but always escaped them
otherwise.

It turns out there is yet another CRTL feature logical name
(DECC$FILENAME_UNIX_NO_VERSION) that tells us a Unix-format
specification is not allowed to have a version number, so in
that case, always escape the semicolon since it can't be the
start of a version specification.

Also, don't add the version number when fileifying directory
specs if this "no versions" feature is in effect.

10 years agoDon't rely on IPC::Cmd in ExtUtils-Install tests
Chris 'BinGOs' Williams [Mon, 10 Mar 2014 11:55:45 +0000 (11:55 +0000)]
Don't rely on IPC::Cmd in ExtUtils-Install tests

10 years agoIt is and always will be safe to delete the most recent key returned from each.
Paul Johnson [Mon, 10 Mar 2014 07:31:32 +0000 (08:31 +0100)]
It is and always will be safe to delete the most recent key returned from each.

10 years agoIncorporate changes from CPAN release of ExtUtils-CBuilder
Chris 'BinGOs' Williams [Sat, 8 Mar 2014 13:45:29 +0000 (13:45 +0000)]
Incorporate changes from CPAN release of ExtUtils-CBuilder

10 years agoUpgrade to Thread::Queue 3.03
Jerry D. Hedden [Thu, 6 Mar 2014 20:56:39 +0000 (15:56 -0500)]
Upgrade to Thread::Queue 3.03

10 years agomake core safe against HvAUX() realloc
David Mitchell [Fri, 7 Mar 2014 17:45:27 +0000 (17:45 +0000)]
make core safe against HvAUX() realloc

Since the HvAUX structure is just tacked onto the end of the HvARRAY()
struct, code like this can do bad things:

    aux = HvAUX();
    ... something that might split hv ...
    aux->foo = ...; /* SEGV! */

So I've visually audited core for places where HbAUX() is saved and then
re-used, and re-initialised the var if it looks like HvARRAY() could
have changed in the meantime.

I've been very conservative about what might be unsafe. For example,
destructors or __WARN__ handlers could call perl code that modifies the
hash.

10 years agosv.h: add some more flag usage commentary
David Mitchell [Fri, 7 Mar 2014 17:13:07 +0000 (17:13 +0000)]
sv.h: add some more flag usage commentary

Also, move SVphv_SHAREKEYS up to be closer to SVf_UTF8 - they are the same
flag bit, but it wasn't clear, since there was a big gap between them

10 years agoData::Dumper update/changelog and version bump
Steffen Mueller [Fri, 7 Mar 2014 08:02:53 +0000 (09:02 +0100)]
Data::Dumper update/changelog and version bump

10 years agoFilter::Simple update/changelog and version bump
Steffen Mueller [Fri, 7 Mar 2014 07:44:06 +0000 (08:44 +0100)]
Filter::Simple update/changelog and version bump

10 years agoAttribute::Handlers update/changelog and version bump
Steffen Mueller [Fri, 7 Mar 2014 07:33:47 +0000 (08:33 +0100)]
Attribute::Handlers update/changelog and version bump

10 years agoSmarter handling of escaped semicolons in vmsify.
Craig A. Berry [Fri, 7 Mar 2014 00:39:18 +0000 (18:39 -0600)]
Smarter handling of escaped semicolons in vmsify.

In theory, a Unix-format filespec can contain a semicolon and thus
need to be escaped when converted to a VMS-format filespec.  But
a much more common use case is a filespec that has a version
number despite being in Unix format.

So detect a semicolon that delimits a version specification and
pass it through but escape other semicolons.  This is apparently
what decc$to_vms does, so we're being consistent with the CRTL.

10 years agoUpdate META files and remove blead customizations following previous commit
Steve Hay [Thu, 6 Mar 2014 08:38:03 +0000 (08:38 +0000)]
Update META files and remove blead customizations following previous commit

(The customizations were added to "fix" failures caused by the previous
upgrade of CPAN::Meta. This upgrade reverts the offending parts, so those
"fix"es can now be reverted too.)

10 years agoUpgrade CPAN::Meta from version 2.140630 to 2.140640
Steve Hay [Thu, 6 Mar 2014 08:25:07 +0000 (08:25 +0000)]
Upgrade CPAN::Meta from version 2.140630 to 2.140640

10 years agoofficially discourage the use of threads
Ricardo Signes [Thu, 6 Mar 2014 01:39:07 +0000 (20:39 -0500)]
officially discourage the use of threads

some language borrowed from a larger patch by Christian Walde

10 years agonote that the ~~ operator is experimental
Ricardo Signes [Sat, 22 Feb 2014 03:25:19 +0000 (22:25 -0500)]
note that the ~~ operator is experimental

(cherry picked from commit 43c6e0a7ba1950c4a64b59be5d0a9cd7b1807cca)

10 years agoMaintainers.pl: Refer to recent EU::ParseXS release
Steffen Mueller [Wed, 5 Mar 2014 17:40:16 +0000 (18:40 +0100)]
Maintainers.pl: Refer to recent EU::ParseXS release

10 years agoEU::ParseXS: Code cleanup
Steffen Mueller [Wed, 5 Mar 2014 17:06:25 +0000 (18:06 +0100)]
EU::ParseXS: Code cleanup

General refactoring to make the code (marginally) easier to follow
and more consistent. This should not result in a change in behaviour.
Includes version bump to 3.24.

10 years agoTemporary fixes for test failures after (Parse::)CPAN::Meta upgrades
Steve Hay [Wed, 5 Mar 2014 10:11:53 +0000 (10:11 +0000)]
Temporary fixes for test failures after (Parse::)CPAN::Meta upgrades

10 years agoUpgrade Locale-Codes from version 3.29 to 3.30
Steve Hay [Wed, 5 Mar 2014 09:06:11 +0000 (09:06 +0000)]
Upgrade Locale-Codes from version 3.29 to 3.30

10 years agoUpdate META files following previous two commits
Steve Hay [Wed, 5 Mar 2014 08:55:03 +0000 (08:55 +0000)]
Update META files following previous two commits

10 years agoUpgrade Parse-CPAN-Meta from version 1.4413 to 1.4414
Steve Hay [Wed, 5 Mar 2014 08:47:42 +0000 (08:47 +0000)]
Upgrade Parse-CPAN-Meta from version 1.4413 to 1.4414

10 years agoUpgrade CPAN-Meta from version 2.133380 to 2.140630
Steve Hay [Wed, 5 Mar 2014 08:42:20 +0000 (08:42 +0000)]
Upgrade CPAN-Meta from version 2.133380 to 2.140630

10 years agoregcomp.c: Use minimal struct formal parameter
Karl Williamson [Wed, 5 Mar 2014 00:55:10 +0000 (17:55 -0700)]
regcomp.c: Use minimal struct formal parameter

The static function get_ANYOF_cp_list_for_ssc() takes a struct formal
parameter that is a superset of what it actually uses.  The calls to it
have to cast to that superset.  By setting the parameter to the smallest
structure it uses, we simplify things.

10 years agoregcomp.c: Don't read uninitialized data
Karl Williamson [Wed, 5 Mar 2014 00:43:11 +0000 (17:43 -0700)]
regcomp.c: Don't read uninitialized data

The blamed commit failed to check whether the data is present before
reading it.

I believe that this creates false positives in te optimizer, so no
actual failures ensued.

10 years agodist/IO: Allow to be dual-lived
Karl Williamson [Tue, 4 Mar 2014 23:13:36 +0000 (16:13 -0700)]
dist/IO: Allow to be dual-lived

This dual-lived module has not been able to be compiled on releases
earlier than 5.10.1 since, I believe, that release, and not outside of
blead since commit 6f2d5cbc in the 5.19 series, both due to using macros
that were not backported.

This commit suitably defines the current missing macro when it isn't
available.

10 years ago[perl #121362] overload optimisation added a SEGV
David Mitchell [Tue, 4 Mar 2014 19:03:02 +0000 (19:03 +0000)]
[perl #121362] overload optimisation added a SEGV

My recent commit 3d147ac29d12abdb to "speed up (non)overloaded derefs"
introduced a potential SEGV. In Perl_Gv_AMupdate(), the 'aux' variable is
set to HvAUX(hv). My patch used the value of the variable later on in the
function, but it turns out that by then, S_hsplit() may have been called,
and thus HvARRAY (and HvAUX()) may have been reallocated.

Issue first spotted by Andreas' awesome BBC service, and diagnosed by
Nicholas Clark.

10 years agoBump Carp to version 1.33
Chris 'BinGOs' Williams [Mon, 3 Mar 2014 22:51:18 +0000 (22:51 +0000)]
Bump Carp to version 1.33

Triggered by commit b82e68e8acf012df784511a23ba8b2dfbc3853b8

10 years agoBump autouse version to 1.08
Chris 'BinGOs' Williams [Mon, 3 Mar 2014 22:45:52 +0000 (22:45 +0000)]
Bump autouse version to 1.08

Triggered by the following:
commit 0c6e98c726c248c4e5b9b4d00c6c9ea74f783997
commit aa86db36e6778689f4a9d13c9af25e2020f46bf4

10 years agoRefactor and reduce VMS-specific workarounds in POSIX.xs.
Craig A. Berry [Sun, 2 Mar 2014 23:58:31 +0000 (17:58 -0600)]
Refactor and reduce VMS-specific workarounds in POSIX.xs.

Most of this code presupposes pre-7.0 VMS systems, but v7.0 was
released in 1995 and pre-7.0 was desupported in Perl in 5.16. So
slim down to what's needed for the most recent couple of decades.

10 years agotbuffer_t no longer exists on VMS.
Craig A. Berry [Sun, 2 Mar 2014 14:33:28 +0000 (08:33 -0600)]
tbuffer_t no longer exists on VMS.

It was replaced by the standard tms struct in v7.0, released in
1995.  Explicit support for pre-7.0 was removed in 32995a382d65b
for Perl 5.16, but I missed the tbuffer_t bit, which tripped up
Nicholas in 25983af42cdcf2dc, because he asked for:

  struct tbuffer_t

which via macro expansion became:

  struct struct tms

which failed to compile.  So remove code that's unnecessarily
different on VMS, leaving only a tbuffer_t compatibility macro
with a more appropriate comment so it will hopefully be less
likely to get used in new code.

10 years agoMerge changes to make_ext.pl that build simple extensions directly.
Nicholas Clark [Sun, 2 Mar 2014 06:17:28 +0000 (07:17 +0100)]
Merge changes to make_ext.pl that build simple extensions directly.

This adds complexity and duplicate logic to make_ext.pl, but reduces build
times. The build time reduction can be significant on platforms which can't
run parallel builds - VMS build time decreased by 39%.

10 years agoOn VMS, lib is lib.DIR, etc. make_ext.pl needs to account for this.
Nicholas Clark [Sat, 1 Mar 2014 10:39:27 +0000 (11:39 +0100)]
On VMS, lib is lib.DIR, etc. make_ext.pl needs to account for this.

Likewise regular files without periods in the names get one appended.

Also, the file generated is pm_to_blib.ts, not pm_to_blib.

10 years agoDescribe the improvements to make_ext.pl in perldelta.
Nicholas Clark [Thu, 27 Feb 2014 15:40:54 +0000 (16:40 +0100)]
Describe the improvements to make_ext.pl in perldelta.

10 years agoGenerate fallback shell cleanup code for the extensions make_ext.pl handles.
Nicholas Clark [Thu, 27 Feb 2014 12:34:46 +0000 (13:34 +0100)]
Generate fallback shell cleanup code for the extensions make_ext.pl handles.

These try to ensure that `make clean` followed by `make distclean` is the
same as running just `make distclean`.

10 years agomake_ext.pl can handle 4 extensions in dist/ which need a Makefile.PL for CPAN.
Nicholas Clark [Thu, 27 Feb 2014 11:52:32 +0000 (12:52 +0100)]
make_ext.pl can handle 4 extensions in dist/ which need a Makefile.PL for CPAN.

10 years agomake_ext.pl can also handle extensions with a module tree at the top level.
Nicholas Clark [Thu, 27 Feb 2014 11:21:54 +0000 (12:21 +0100)]
make_ext.pl can also handle extensions with a module tree at the top level.

This gets us Digest and Memoize.

10 years agomake_ext.pl can also handle extensions with a module file at the top level.
Nicholas Clark [Thu, 27 Feb 2014 10:50:56 +0000 (11:50 +0100)]
make_ext.pl can also handle extensions with a module file at the top level.

Processing this old-style layout gains us another 6 extensions.

10 years agoFor simple extensions make_ext.pl can emulate the entire MakeMaker/make dance.
Nicholas Clark [Thu, 27 Feb 2014 10:04:19 +0000 (11:04 +0100)]
For simple extensions make_ext.pl can emulate the entire MakeMaker/make dance.

For simple extensions consisting only of Perl modules and Pod, EU::MM
generates a Makefile where the only target that does any work as part of
'all' is 'pm_to_blib', and *that* is just running perl to call
ExtUtils::Installed::pm_to_blib() with those files as arguments, and then
touching pm_to_blib.

Because the top level Makefile's dependency rule for "is an extension built"
is looking for that file pm_to_blib, and all builds (and cleans) of
extension directories are performed by running make_ext.pl, not a direct
recursive make, it means that make_ext.pl can actually directly emulate the
entire work done by EU::MM and make in this particular case. This means that
we save (at least) three subprocesses:

* miniperl to run Makefile.PL
* make
* miniperl to run ExtUtils::Installed::pm_to_blib()

This change obviously adds some logic duplication, but it roughly halves the
time taken for `make test_prep` to figure out that nothing needs doing.
And obviously also saves at least that much time on the actual build, which
may well be 60 seconds / number of cores.

10 years agoChange the test to use itself as test file, instead of the generated Makefile.
Nicholas Clark [Thu, 27 Feb 2014 09:56:11 +0000 (10:56 +0100)]
Change the test to use itself as test file, instead of the generated Makefile.

The generated Makefile is about to go away :-)

10 years agoExtract fallback_cleanup() to hold the code that writes cleanup shell scripts.
Nicholas Clark [Thu, 27 Feb 2014 09:21:52 +0000 (10:21 +0100)]
Extract fallback_cleanup() to hold the code that writes cleanup shell scripts.

10 years agomake_ext.pl should validate exactly which clean targets it can be used for.
Nicholas Clark [Thu, 27 Feb 2014 09:20:38 +0000 (10:20 +0100)]
make_ext.pl should validate exactly which clean targets it can be used for.

Previously it would accept anything matching /clean$/. Now we check for the 4
names that we know the top level Makefile defines.

10 years agoregen/regcharclass.pl: Forbid non-safe macros for multi-char matches
Karl Williamson [Sun, 2 Mar 2014 02:35:00 +0000 (19:35 -0700)]
regen/regcharclass.pl: Forbid non-safe macros for multi-char matches

For matches that can match more than a single code point, one should
always use a macro that makes sure that one doesn't read off the end of
the buffer.  This is because the buffer might end with the first N
characters of a sequence with at least N+1 in it, and we don't want to
read that N+1 position in the buffer.

If this had been in place, buggy commit 3a8bbffbce would not have
happened.

10 years agoregen/regcharclass.pl: Don't generate unused macros
Karl Williamson [Sun, 2 Mar 2014 02:27:43 +0000 (19:27 -0700)]
regen/regcharclass.pl: Don't generate unused macros

The macros generated by these options are not needed in the core;
generating them just clutters up the header file, and some will actually
be forbidden by the next commit.

10 years agoRevert most of 3a8bbffbce: Avoid unnecessary malformed checking
Karl Williamson [Sun, 2 Mar 2014 01:47:10 +0000 (18:47 -0700)]
Revert most of 3a8bbffbce: Avoid unnecessary malformed checking

My thinking was muddled when I made that commit, and this reverts the
essence of it.  The theory was that since we have already processed the
regex pattern, we don't need to check it for malformedness, hence we
don't need the "safe" form of certain macros that check for and avoid
running off the end of the buffer.  It is true that we don't have to
worry about malformedness indicating that the buffer is bigger than it
really is, but these macros can match up to three well-formed
characters, so we do have to make sure that all three are in the buffer,
and that the input isn't just the first two at the buffer's end.

This was caught by running valgrind.

10 years agoperluniprops: Show property name without braces
Karl Williamson [Sun, 2 Mar 2014 01:28:30 +0000 (18:28 -0700)]
perluniprops: Show property name without braces

Properties wth single letter names may be expressed with and without the
brakces; \p{L} and \pL are synonymous.  This commit makes both forms
be in perluniprops, so someone who doesn't know the detailed rules can
search for either to see what it is.

This was suggested by Zsbán Ambrus.

10 years agoregen/regcharclass.pl: White-space; comment nits only
Karl Williamson [Fri, 28 Feb 2014 18:46:10 +0000 (11:46 -0700)]
regen/regcharclass.pl: White-space; comment nits only

Indent to account for new block added in the previous commit

10 years agoregen/regcharclass.pl: Simplify generated safe macros
Karl Williamson [Fri, 28 Feb 2014 18:24:01 +0000 (11:24 -0700)]
regen/regcharclass.pl: Simplify generated safe macros

This simplifies the macros generated which make sure there are no read
errors.  Prior to this commit, the code generated looked like

      (e - s) > 3
      ? see if things of at most length 4 match
      : (e - s) > 2
        ? see if things of at most length 3 match
        : (e - s) > 1
          ? see if things of at most length 2 match
          : (e - s) > 0
            ? see if things of at most length 1 match

For things that are a single character, the ones greater than length 2
must be in UTF8, and their needed length can be determined by UTF8SKIP,
so we can get rid of most of the (e-s) tests.

This doesn't change the macros which can match multiple characters; that
is a harder to do.

10 years agoUnicode/UCD.t: Fix broken test
Karl Williamson [Fri, 28 Feb 2014 17:27:49 +0000 (10:27 -0700)]
Unicode/UCD.t: Fix broken test

The test file special cases certain properties by name.  However, it
turns out that a Unihan property that isn't normally compiled by Perl
also should be included.  And all these properties share the same format
given in their files.  So, instead of using the property names, use that
format; this leads to code which is general, and simpler at the same time.

10 years agomktables: Allow Unicode Unihan files to compile
Karl Williamson [Fri, 28 Feb 2014 16:58:33 +0000 (09:58 -0700)]
mktables: Allow Unicode Unihan files to compile

Perl normally doesn't include the Unicode Unihan files, but someone is
free to recompile Perl with these.  However, starting with commit
9e65c3f47e483ee7e33b5d748a06f4addd830d60, mktables checks for the
version number on the input files and refuses to compile if incorrect.
(This is to catch Perl trying to compile from a DB with inconsistent
files; I believe Perl used to be shipped with these synchronization
errors.)  However, the Unihan files in Unicode 6.3 do not have the same
syntax as the rest of the files, so since that commit Perl refuses to
compile Unihan.

The files are being updated in 7.0 to use the same syntax as the rest,
so rather than hard-code the current syntax as an exception into
mktables, this just skips checking these files until 7.0.

10 years agoregen/regcharclass.pl: Warn that macros are internal only
Karl Williamson [Thu, 27 Feb 2014 17:25:24 +0000 (10:25 -0700)]
regen/regcharclass.pl: Warn that macros are internal only

This adds a comment to the generated file that the macros are not to be
generally used.

10 years agoNo need for code conditional on S_IFMT being defined, as perl.h has a fallback.
Nicholas Clark [Sat, 1 Mar 2014 16:58:05 +0000 (17:58 +0100)]
No need for code conditional on S_IFMT being defined, as perl.h has a fallback.

Commit c623bd54707a8bf9 (Jan 1991) added code conditionally compiled if
S_IFMT was defined. However, the checks were immediately redundant, because
the same commit also added code to perl.h to define a fallback value for
S_IFMT if the OS headers did not define it, which is unchanged to this day.
Hence the code added in an #else as part of commit 99b89507a1fb507c (Nov
1991) has never ever been needed.

10 years agopp_tms should use a local struct tms, instead of PL_timesbuf.
Nicholas Clark [Sat, 1 Mar 2014 16:40:05 +0000 (17:40 +0100)]
pp_tms should use a local struct tms, instead of PL_timesbuf.

PL_timesbuf is effectively a vestige of Perl 1, and doesn't actually need to
be an interpreter variable. It will be removed early in v5.21.x, but it's a
good idea to refactor the code not to use it before then. A local struct tms
will be on the C stack, which will be in the CPU's L1 cache, whereas the
relevant part of the interpreter struct may well not be in the CPU cache at
all. Therefore this change might reduce cache pressure fractionally. A local
variable access should also be simpler machine code on most CPU architectures.