This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
7 years agoPerl_do_vop(): enhance "avoid sv_catpvn"
David Mitchell [Wed, 9 Nov 2016 11:50:35 +0000 (11:50 +0000)]
Perl_do_vop(): enhance "avoid sv_catpvn"

TonyC's recent commit v5.25.6-172-gdc529e6 updated do_vop() to avoid
doing a sv_catpvn() when the left and destination SVs are the same.
As well as being more efficient, it is needed, as a recent change to
sv_catpvn() made it more likely to grow and realloc the buffer, meaning
the copy()'s src buffer had been freed.

This commit represents my parallel attempt to fix the same issue; I'm
replacing Tony's version with mine as it is logically more comprehensive:
it copes with the dest being the same as the right arg as well as the
left, and checks for string pointers being equal rather than sv's being
equal. Neither of these make any difference currently, but they could in
theory (although unlikely) catch some future change in usage.

RT #129995

7 years agohandle SvIMMORTALs in LHS of list assign
David Mitchell [Tue, 8 Nov 2016 12:26:12 +0000 (12:26 +0000)]
handle SvIMMORTALs in LHS of list assign

RT #129991: this code fails an assert that the LHS is not SvIMMORTAL:

    perl -e  '($_,$0)=(1,0) for 0 gt 0'

The 'set SVf_BREAK flag in a mark and sweep' code I wrote to look for
common elements, skips PL_sv_undef on the LHS. It should also skip
other SvIMMORTAL SVs like PL_sv_yes, but the SvIMMORTAL() test is
more expensive than a simple (sv == &PL_sv_undef), and I couldn't think of
a case where a LHS would be immortal but not sv_undef.

So I added an assert instead.

The above code shows that it was in fact possible, so test for SvIMMORTAL
instead.

7 years agoStefan Seifert is now a perl author
Tony Cook [Wed, 9 Nov 2016 03:59:38 +0000 (14:59 +1100)]
Stefan Seifert is now a perl author

7 years agoclarify the contents of argv[]
Stefan Seifert [Wed, 9 Nov 2016 03:49:07 +0000 (14:49 +1100)]
clarify the contents of argv[]

7 years agoskip some tests that aren't UTF-EBCIDIC compatible on non-ASCII
Tony Cook [Wed, 9 Nov 2016 03:16:21 +0000 (14:16 +1100)]
skip some tests that aren't UTF-EBCIDIC compatible on non-ASCII

7 years ago(perl #129000) use the new utf8_hop_back()
Tony Cook [Wed, 9 Nov 2016 03:09:23 +0000 (14:09 +1100)]
(perl #129000) use the new utf8_hop_back()

when reporting unrecognized characters in UTF mode.

7 years ago(perl #129000) create a safer utf8_hop()
Tony Cook [Mon, 31 Oct 2016 03:28:34 +0000 (14:28 +1100)]
(perl #129000) create a safer utf8_hop()

Unlike utf8_hop(), utf8_hop_safe() won't navigate before the
beginning or after the end of the supplied buffer.

The original version of this put all of the logic into
utf8_hop_safe(), but in many cases a caller specifically
needs to go forward or backward, and supplying the other limit
made the function less usable, so I split the function
into forward and backward cases.

This split may also make inlining these functions more efficient
or more likely.

7 years agoUpgrade podlators from version 4.08 to 4.09
Steve Hay [Tue, 8 Nov 2016 14:02:01 +0000 (14:02 +0000)]
Upgrade podlators from version 4.08 to 4.09

7 years agoUpdate Archive-Tar to CPAN version 2.18
Chris 'BinGOs' Williams [Mon, 7 Nov 2016 13:29:13 +0000 (13:29 +0000)]
Update Archive-Tar to CPAN version 2.18

  [DELTA]

2.18  07/11/2016 (JHI)
- Capture also the STDERR when checking tar exe

2.16  01/11/2016 (JHI && CBERRY)
- Make roundtrip tar exe finding robust for crappy tars

7 years agoperlvar: clarify @ISA recommendations
Aristotle Pagaltzis [Mon, 7 Nov 2016 08:03:11 +0000 (09:03 +0100)]
perlvar: clarify @ISA recommendations

7 years agoperlvar: document @ISA
Hauke D [Tue, 1 Nov 2016 11:53:38 +0000 (12:53 +0100)]
perlvar: document @ISA

It was documented in a few other places but not in perlvar.

7 years agoperlobj: do not discourage manual @ISA
Aristotle Pagaltzis [Mon, 7 Nov 2016 07:51:51 +0000 (08:51 +0100)]
perlobj: do not discourage manual @ISA

7 years agoperlobj: remove now-inaccurate claim
Aristotle Pagaltzis [Mon, 7 Nov 2016 07:36:25 +0000 (08:36 +0100)]
perlobj: remove now-inaccurate claim

7 years ago(perl #129995) avoid sv_catpvn() in do_vop() when unneeded
Tony Cook [Mon, 7 Nov 2016 00:22:55 +0000 (11:22 +1100)]
(perl #129995) avoid sv_catpvn() in do_vop() when unneeded

This could call sv_catpvn() with the source string being within the
destination SV, which caused a freed memory access if do_vop() and
sv_catpvn_flags() had different ideas about the ideal size of the
target SV's buffer.

7 years agoAdded note about perlobj change to perldelta
Dave Rolsky [Tue, 1 Nov 2016 19:34:03 +0000 (14:34 -0500)]
Added note about perlobj change to perldelta

7 years agoAdd docs on calling methods using a fully qualified name like $mp3->File::save()
Lukas Mai [Tue, 1 Nov 2016 19:25:21 +0000 (14:25 -0500)]
Add docs on calling methods using a fully qualified name like $mp3->File::save()

7 years agoSmall formatting fix in perlobj
Dave Rolsky [Tue, 1 Nov 2016 19:24:45 +0000 (14:24 -0500)]
Small formatting fix in perlobj

7 years agoAdd a few more mentions of Moo to perlootut
Dave Rolsky [Tue, 1 Nov 2016 19:21:44 +0000 (14:21 -0500)]
Add a few more mentions of Moo to perlootut

Also ran Porting/podtidy which reformatted a few lines.

7 years agoutf8.c: No need to look at trailing NUL in comparing string
Karl Williamson [Sun, 6 Nov 2016 01:05:41 +0000 (02:05 +0100)]
utf8.c: No need to look at trailing NUL in comparing string

I meant to get this into commit
b0b342d4b3fa61880a96b645a3dab648f7c4c682, but didn't.  Subtract 1 from
the sizeof a constant string to get the number of bytes to compare, as
we don't need to look at the trailing NUL.

7 years agocustomized.dat regen
Jarkko Hietaniemi [Sat, 5 Nov 2016 23:01:49 +0000 (19:01 -0400)]
customized.dat regen

7 years agoVersion bump
Jarkko Hietaniemi [Sat, 5 Nov 2016 23:01:35 +0000 (19:01 -0400)]
Version bump

7 years agoCapture also the stderr, the message from tar might go there
Jarkko Hietaniemi [Sat, 5 Nov 2016 22:58:51 +0000 (18:58 -0400)]
Capture also the stderr, the message from tar might go there

Follow-up to 202b0c8a3ba3de0efe5cb730b242b8c0502e1add

7 years agonetbsd-vax: no infinity
Jarkko Hietaniemi [Sat, 5 Nov 2016 18:10:56 +0000 (14:10 -0400)]
netbsd-vax: no infinity

The tests were not failing, but being a bit noisy.

7 years agocall AV set magic in list assign
David Mitchell [Fri, 4 Nov 2016 15:42:37 +0000 (15:42 +0000)]
call AV set magic in list assign

RT #129996

Perl used to do this, but I broke it with my recent commit
v5.25.6-78-g8b0c337.

Normally if @a has set magic, then that magic gets called for each
av_store() call; e.g. in @a = (1,2,3), the magic should get called 3
times.

I broke that because I was checking for SVs_RMG rather than SVs_SMG, and
it so happens that no core code sets SVs_SMG on an AV without setting
SVs_RMG too. However, code such as Tk (which use PERL_MAGIC_ext magic),
does.

This commit re-instates the AV behaviour.

Oddly enough, hv_store_ent() etc *don't* call HV set magic. I've added
some tests for that, but marked them TODO because I'm not sure what the
correct behaviour should be.

7 years agonetbsd-vax: customized.dat update for S-L-U
Jarkko Hietaniemi [Fri, 4 Nov 2016 12:52:46 +0000 (08:52 -0400)]
netbsd-vax: customized.dat update for S-L-U

7 years agonetbsd-vax: also the 1E1000 is toxic (in compiletime).
Jarkko Hietaniemi [Fri, 4 Nov 2016 12:43:40 +0000 (08:43 -0400)]
netbsd-vax: also the 1E1000 is toxic (in compiletime).

7 years agoconfigure.com: missing ELSE in usethreads logic
Craig A. Berry [Fri, 4 Nov 2016 01:17:36 +0000 (20:17 -0500)]
configure.com: missing ELSE in usethreads logic

This would only bite if an unknown compiler had been selected, but
there is a port of clang in progress, so try to be ready for
anything.

7 years agoFix typos in test comment
Dagfinn Ilmari Mannsåker [Thu, 3 Nov 2016 13:53:45 +0000 (13:53 +0000)]
Fix typos in test comment

7 years agoCompiler choice clean-up in configure.com.
Craig A. Berry [Thu, 3 Nov 2016 13:15:47 +0000 (08:15 -0500)]
Compiler choice clean-up in configure.com.

VAXC has not been a possibility for a good long while, and the
versions of the DEC/Compaq/HP/VSI C compiler that report themselves
as "DEC" in a listing file are 15 years or more out-of-date and
can be safely desupported.

7 years agoskip SEGVing test in t/uni/overload.t
David Mitchell [Thu, 3 Nov 2016 11:20:50 +0000 (11:20 +0000)]
skip SEGVing test in t/uni/overload.t

This TODO test is expected to SEGV, and is run using fresh_perl().
But that doesn't stop the shell issuing this scary noise to STDERR:

    sh: line 1:  5106 Segmentation fault      (core dumped) /home/davem/perl5/gi
t/bleed/perl "-I../lib" "tmp5097A" 2>&1

So until this is fixed, just skip the test. See [perl #129933]

7 years agoNet::Ping 500_ping_icmp.t: remove sudo code
David Mitchell [Thu, 3 Nov 2016 11:06:25 +0000 (11:06 +0000)]
Net::Ping 500_ping_icmp.t: remove sudo code

Rcently this  test scipt had code added to it to attempt to re-run itself
as root by invoking 'sudo' rather rather than just skipping the ICMP ping
test.

This can the side-effects of:

* sudo sending a security alert email to the local root account;

* a script being run as root when a non-root user invokes 'make test',
  which might be considered antisocial;

* noise on stderr about sudo failing.

See http://nntp.perl.org/group/perl.perl5.porters/240707.

This commit just removes the sudo code and doesn't try to do anything
clever.

7 years agoMake toke.c:S_lop's x arg a U8 to match PL_expect
Andy Lester [Thu, 3 Nov 2016 10:54:36 +0000 (10:54 +0000)]
Make toke.c:S_lop's x arg a U8 to match PL_expect

The second argument to S_lop() is an int, but it gets stored in
PL_expect which is a U8.  If we need a U8, then let's bring it
into the function as a U8.

7 years agofix hv.h build breakage
David Mitchell [Thu, 3 Nov 2016 10:32:33 +0000 (10:32 +0000)]
fix hv.h build breakage

The previous commit had a double closing comment (*/)

7 years agoadd a comment about the properties of struct hek
Yves Orton [Thu, 3 Nov 2016 09:03:26 +0000 (10:03 +0100)]
add a comment about the properties of struct hek

7 years agoRevert "hv.h: rework HEK_FLAGS to a proper member in struct hek"
Tony Cook [Thu, 3 Nov 2016 00:12:57 +0000 (11:12 +1100)]
Revert "hv.h: rework HEK_FLAGS to a proper member in struct hek"

This reverts commit d3148f758506efd28325dfd8e1b698385133f0cd.

SV keys are stored as pointers in the key_key, on platforms with
alignment requirements (such as PA-RISC) this resulted in bus errors
early in the build.

7 years agoFix wrong UTF-8 overflow error on 32-bit platforms
Karl Williamson [Wed, 2 Nov 2016 04:12:51 +0000 (22:12 -0600)]
Fix wrong UTF-8 overflow error on 32-bit platforms

Commit 2b5e7bc2e60b4c4b5d87aa66e066363d9dce7930 changed the algorithm
for detecting overflow during decoding UTF-8 into code points.  However,
on 32-bit platforms, this change caused it to claim some things overflow
that really don't.  ALl such are overlong malformations, which are
normally forbidden, but not necessarily.  This commit fixes that.

7 years agoAPItest/t/utf8.t: Correct to uppercase in print
Karl Williamson [Wed, 2 Nov 2016 04:13:21 +0000 (22:13 -0600)]
APItest/t/utf8.t: Correct to uppercase in print

This worked so long as we didn't have hex digits A-F.

7 years agomacOS (10.12) deprecated syscall(2).
Jarkko Hietaniemi [Wed, 2 Nov 2016 20:49:52 +0000 (16:49 -0400)]
macOS (10.12) deprecated syscall(2).

7 years agofix taint handling in list assignment
David Mitchell [Wed, 2 Nov 2016 16:05:54 +0000 (16:05 +0000)]
fix taint handling in list assignment

My recent commit v5.25.6-79-gb09ed99 reworked list assignment, and
accidentally broke taint handling at the same time.

The basic idea is that each element is independent; in:

    ($a, $b, ...) = ($tainted, $untainted, ...);

$a should end up tainted, $b should end up untainted, the statement
containing the assign should remain untainted, and if the statement was
already tainted it shouldn't affect the assign.

Surprisingly this is completely untested, which is why I failed to spot it
when I broke it.

Now fixed. In fact in addition I spotted something that had always been
broken, and fixed that too: it was tainting the rest of the statement; in:

    (($a) = ($TAINT. "x")), ($b = $b . "x");

The taint in the list assign to $a was lingering to mess up and taint $b.

Prior to v5.25.6-79-gb09ed99 , pp_assign looked roughly like:

    for (...each lhs elem...) {
        TAINT_NOT;
        switch (lhs type) {
        case scalar:
            assign a value to lhs;
            break;
        case SVt_PVAV:
            av_clear();
            for (...each rhs elem...)
                sv = newSV(0);
                sv_setsv(sv, rhs_elem);
                av_store(av, i, sv);
                TAINT_NOT;
            }
            break;
        }
        case SVt_PVHV:
            ...similarly...
    }

Commit v5.25.6-79-gb09ed99 accidentally removed *all* the TAINT_NOT's.

This commit re-adds the first TAINT_NOT, but doesn't re-add the
per-array/hash TAINT_NOT's, on the grounds that the aggregates are first
emptied, so any elements being assigned to will be fresh and can't have
taint magic attached, so calling mg_set() on them won't set the taint
value to 1 even if PL_tainted is set.

But this commit does add an extra TAINT_NOT *after* the outer loop, which
is what I think is fixing a longstanding bug.

7 years ago[perl #130001] h2xs: avoid infinite loop for enums
Hugo van der Sanden [Fri, 28 Oct 2016 12:27:23 +0000 (13:27 +0100)]
[perl #130001] h2xs: avoid infinite loop for enums

'typedef enum x { ... } x' causes h2xs to enter a substitution loop while
trying to write the typemap file.

7 years agoclarify behavior single quote regexps
Yves Orton [Wed, 2 Nov 2016 09:53:18 +0000 (10:53 +0100)]
clarify behavior single quote regexps

The documentation was ambiguous about what type of interpolation
was disabled in single quote regexps. It is a bit debateable whether
"\n" in a regex is a regexp meta-escapes which happens to match "\n",
or if it is a string escape that needs to be interpolated. Since single
quote regexps should allow regexp meta-escapes (for instance \s), then
it makes more sense to treat \n and \x{..} also as regexp meta-escapes,
which then leaves nothing but variables that /could/ be interpolated.

This effectively officially defines the current behavior as correct,
and will allow us to close a number of tickets because of it. In
particular we can close #21491 as "not a bug", and probably also related
tickets.

7 years agoUpgrade Net::Ping from version 2.51 to 2.55
Steve Hay [Wed, 2 Nov 2016 08:18:01 +0000 (08:18 +0000)]
Upgrade Net::Ping from version 2.51 to 2.55

(This retains the blead customizations from 01b515d1d7 and 0fc44d0a18.)

7 years agoTreat VSI C the same as DEC/Compaq/HP C.
Craig A. Berry [Wed, 2 Nov 2016 00:06:06 +0000 (19:06 -0500)]
Treat VSI C the same as DEC/Compaq/HP C.

7 years agoUpgrade Unicode::Collate from version 1.14 to 1.17
Steve Hay [Tue, 1 Nov 2016 17:44:52 +0000 (17:44 +0000)]
Upgrade Unicode::Collate from version 1.14 to 1.17

7 years agoUpgrade Test::Simple from version 1.302059 to 1.302062
Steve Hay [Tue, 1 Nov 2016 17:35:01 +0000 (17:35 +0000)]
Upgrade Test::Simple from version 1.302059 to 1.302062

7 years agoUpgrade Term::ANSIColor from version 4.05 to 4.06
Steve Hay [Tue, 1 Nov 2016 17:29:33 +0000 (17:29 +0000)]
Upgrade Term::ANSIColor from version 4.05 to 4.06

7 years agorework perl #129903 - inf recursion from use of empty pattern in regex codeblock
Yves Orton [Mon, 31 Oct 2016 19:22:37 +0000 (20:22 +0100)]
rework perl #129903 - inf recursion from use of empty pattern in regex codeblock

FC didn't like my previous patch for this issue, so here is the
one he likes better. With tests and etc. :-)

The basic problem is that code like this: /(?{ s!!! })/ can trigger
infinite recursion on the C stack (not the normal perl stack) when the
last successful pattern in scope is itself. Since the C stack overflows
this manifests as an untrappable error/segfault, which then kills perl.

We avoid the segfault by simply forbidding the use of the empty pattern
when it would resolve to the currently executing pattern.

I imagine with a bit of effort someone can trigger the original SEGV,
unlike my original fix which forbade use of the empty pattern in a
regex code block. So if someone actually reports such a bug we might
have to revert to the older approach of prohibiting this.

7 years agonew feature @{^CAPTURE} (and %{^CAPTURE} and %{^CAPTURE_ALL})
Yves Orton [Mon, 31 Oct 2016 21:44:31 +0000 (22:44 +0100)]
new feature @{^CAPTURE} (and %{^CAPTURE} and %{^CAPTURE_ALL})

@{^CAPTURE} exposes the capture buffers of the last match
as an array. So $1 is ${^CAPTURE}[0].

%{^CAPTURE} is the equivalent to %+ (ie named captures)

%{^CAPTURE_ALL} is the equivalent to %- (ie all named captures).

7 years agoSkip the subnormals tests in tru64.
Jarkko Hietaniemi [Tue, 1 Nov 2016 00:45:03 +0000 (20:45 -0400)]
Skip the subnormals tests in tru64.

At first I thought these would be ftz/daz problems
(flush-to-zero/denormals-are-zero), compiled with bare cc those seem
to happen with denormals (e.g. DBL_MIN * 0.5), but the "cc -ieee"
which perl is compiled with does make the ftz/daz go away.  Needs
further study.  So make them TODO for now.

7 years ago(perl #129085) avoid memcmp() past the end of a string
Tony Cook [Mon, 29 Aug 2016 05:04:55 +0000 (15:04 +1000)]
(perl #129085) avoid memcmp() past the end of a string

When a match is anchored against the start of a string, the regexp
can be compiled to include a fixed string match against a fixed
offset in the string.

In some cases, where the matched against string included UTF-8 before
the fixed offset, this could result in attempting a memcmp() which
overlaps the end of the string and potentially past the end of the
allocated memory.

7 years ago(perl #128997) avoid reading beyond the end of the line buffer
Tony Cook [Tue, 18 Oct 2016 04:46:48 +0000 (15:46 +1100)]
(perl #128997) avoid reading beyond the end of the line buffer

when there's a short UTF-8 character at the end.

7 years ago(perl #129961) code cleanup for clang -Weverything support
Andy Lester [Mon, 31 Oct 2016 00:35:40 +0000 (11:35 +1100)]
(perl #129961) code cleanup for clang -Weverything support

This patch simplifies two bits of code that I came across while
working on supporting the clang -Weverything flag.

The first, in Perl_validate_proto, removes unnecessary variable
initialization if proto of NULL is passed.

The second, in S_scan_const, rearranges some code and #ifdefs so that
the convert_unicode and real_range_max variables are only declared
if EBCDIC is set.  This lets us no longer have to unnecessarily set
useless variables to make the compiler happy, and it saves us from some
unnecessary checks on "if (convert_unicode)".  One of the comments says
"(Compilers should optimize this out for non-EBCDIC)", but now the
compiler won't even see these unnecessary variables or tests.

7 years agoAdded some discussion of tabs & spaces in the source code
Andy Lester [Sun, 30 Oct 2016 23:46:30 +0000 (10:46 +1100)]
Added some discussion of tabs & spaces in the source code

7 years agofix #129802: sv_grow: remove the overallocation for COW exemption for powers of 2
Yves Orton [Sun, 30 Oct 2016 10:02:57 +0000 (11:02 +0100)]
fix #129802: sv_grow: remove the overallocation for COW exemption for powers of 2

They are just performance bombs waiting to hit the regex engine
and other code. If someone wants this precise level of management
then we should provide an API for them to do so.

Really this just shows the flaw in our current COW implementation.

7 years agofix perl #129802 - overallocate in concat to ensure we can COW
Yves Orton [Sun, 30 Oct 2016 09:56:36 +0000 (10:56 +0100)]
fix perl #129802 - overallocate in concat to ensure we can COW

Otherwise we get degenerate performance in things like the regex
engine under certain cases.

7 years agoXS-APItest/t/utf8.t: Test with longest possible overlong
Karl Williamson [Fri, 28 Oct 2016 14:46:53 +0000 (08:46 -0600)]
XS-APItest/t/utf8.t: Test with longest possible overlong

As part of testing, certain malformations are perturbed to also be
overlong to see that the combination of them is properly handled.  To do
this, the code will take a test case and calculate an overlong that is
longer than it.  However if the test case is as long as the overlong
would be, this can't be done, and is skipped.  This commit now
uses a longer overlong than previously (now the maximum possible) so
that fewer tests have to be skipped.

7 years agoXS-APItest/t/utf8.t: White-space only
Karl Williamson [Fri, 28 Oct 2016 14:44:43 +0000 (08:44 -0600)]
XS-APItest/t/utf8.t: White-space only

7 years agoXS-APItest/t/utf8.t: Fix EBCDIC bug
Karl Williamson [Fri, 28 Oct 2016 14:42:38 +0000 (08:42 -0600)]
XS-APItest/t/utf8.t: Fix EBCDIC bug

This number needs to be adjusted for EBCDIC platforms

7 years agoXS-APItest/t/utf8.t: Move a common expression to $var
Karl Williamson [Fri, 28 Oct 2016 14:36:56 +0000 (08:36 -0600)]
XS-APItest/t/utf8.t: Move a common expression to $var

The maximum byte length of a single code-points UTF-8 representation is
used in a bunch of places.  Calculate it once.

7 years agoXS-APItest/t/utf8.t: Fix wrong test on EBCDIC
Karl Williamson [Fri, 28 Oct 2016 14:31:09 +0000 (08:31 -0600)]
XS-APItest/t/utf8.t: Fix wrong test on EBCDIC

The I8 string doesn't work the same as UTF-8, as it only takes 5 bits
from each continuation byte instead of 6.

7 years agoThe new symbols broke a limit in VMS.
Craig A. Berry [Sat, 29 Oct 2016 02:02:37 +0000 (22:02 -0400)]
The new symbols broke a limit in VMS.

7 years agoUse the new metalevel definitions for fp inf/nan/range
Jarkko Hietaniemi [Thu, 27 Oct 2016 11:46:22 +0000 (07:46 -0400)]
Use the new metalevel definitions for fp inf/nan/range

There are still hacks (in a good sense) of detecting "vax float"
in the cpan/ modules (patches submitted upstream, customized moves done),
but that is fine since the new Config symbols will be available only in
the future.

7 years agoConfigure: add defs summarizing doublekind/longdblkind
Jarkko Hietaniemi [Tue, 25 Oct 2016 02:07:46 +0000 (22:07 -0400)]
Configure: add defs summarizing doublekind/longdblkind

For windows/netware It seems that many of the recent fp definitions
have not been yet copied over there [1] [2], so went mostly by dead
reckoning [3].

[1] Note that many of them are not absolutely necessary for building.
[2] The proper updating involves doing stuff in win32, which I do not have.
[3] As far as I can tell, Windows CE does not really not have long double.

7 years agonetbsd-vax: 2**400 does not fit vax fp
Jarkko Hietaniemi [Thu, 27 Oct 2016 12:03:08 +0000 (08:03 -0400)]
netbsd-vax: 2**400 does not fit vax fp

Note also that the computation needs to be runtime, not compiletime.

7 years agonetbsd-vax: more skippage due to no inf/nan
Jarkko Hietaniemi [Mon, 24 Oct 2016 22:31:57 +0000 (18:31 -0400)]
netbsd-vax: more skippage due to no inf/nan

7 years agoArchive-Tar: customized.dat
Jarkko Hietaniemi [Sat, 29 Oct 2016 01:34:42 +0000 (21:34 -0400)]
Archive-Tar: customized.dat

7 years agoArchive-Tar: Maintainers customization
Jarkko Hietaniemi [Fri, 28 Oct 2016 23:44:27 +0000 (19:44 -0400)]
Archive-Tar: Maintainers customization

7 years agoArchive-Tar: customized version bump
Jarkko Hietaniemi [Fri, 28 Oct 2016 23:42:10 +0000 (19:42 -0400)]
Archive-Tar: customized version bump

7 years agoArchive-Tar: detect if external tar fails
Jarkko Hietaniemi [Fri, 28 Oct 2016 23:38:46 +0000 (19:38 -0400)]
Archive-Tar: detect if external tar fails

7 years agoArchive-Tar: in VMS gnutar requires filenames in native format
Craig A. Berry [Fri, 28 Oct 2016 22:58:03 +0000 (18:58 -0400)]
Archive-Tar: in VMS gnutar requires filenames in native format

7 years agoArchive-Tar: RT #118476: scan for the right tar more robustly
Jarkko Hietaniemi [Fri, 28 Oct 2016 12:32:23 +0000 (08:32 -0400)]
Archive-Tar: RT #118476: scan for the right tar more robustly

(1) Do not assume it is called 'tar'.
(2) Do not assume it has the compression features.
(3) Do not assume there is only one 'tar'.
(4) Do not assume the first one found has the compression features.
(5) Add the platform executable suffix to the name.

7 years agoFix test to be EBCDIC friendly
Karl Williamson [Fri, 28 Oct 2016 00:58:18 +0000 (18:58 -0600)]
Fix test to be EBCDIC friendly

Commit da42332b10691ba7af7550035ffc7f46c87e4e66 introduced a new test.
But on EBCDIC platforms that test doesn't do what it is intended.  It
uses \xE4, assuming it will have a different representation when encoded
in UTF-8, and it is trying to test that having a different
representation still works.  But \xE4 on EBCDIC is a UTF-8 invariant
(CAPITAL U).

perlhacktips gives some suggestions on writing tests that work on both
character sets.  In this case \xB6, that is mentioned there, works, as
it is UTF-8 variant on both character sets, and all EBCDIC code pages that
have ever been supported by Perl.

7 years agoregcomp.c: document the trie common prefix logic
Yves Orton [Thu, 27 Oct 2016 20:35:21 +0000 (22:35 +0200)]
regcomp.c: document the trie common prefix logic

I wrote this code some time ago. It is somewhat of
a state machine with some interesting implicit
assumptions which took me a while to remember. While
I do it seems reasonable to document them so the next
guy (maybe/probably me) doesn't have to think so hard.

7 years agoregcomp.c: avoid some unnecessary work when it wont be used
Yves Orton [Thu, 27 Oct 2016 20:34:49 +0000 (22:34 +0200)]
regcomp.c: avoid some unnecessary work when it wont be used

7 years agoregcomp.c: in trie common prefix logic rename idx to first_ofs
Yves Orton [Thu, 27 Oct 2016 20:32:09 +0000 (22:32 +0200)]
regcomp.c: in trie common prefix logic rename idx to first_ofs

Using 'idx' and 'ofs' interchangably is confusing, calling
this first_ofs makes it more obvious what it is used for.

7 years agoregcomp.c: whitespace only change, break up dense code/long line
Yves Orton [Thu, 27 Oct 2016 20:28:55 +0000 (22:28 +0200)]
regcomp.c: whitespace only change, break up dense code/long line

7 years agoregcomp.c: add a comment about the trie logic
Yves Orton [Thu, 27 Oct 2016 20:28:30 +0000 (22:28 +0200)]
regcomp.c: add a comment about the trie logic

7 years agoregcomp.c: refactor TRIE bitmap logic to a macro
Yves Orton [Thu, 27 Oct 2016 20:26:39 +0000 (22:26 +0200)]
regcomp.c: refactor TRIE bitmap logic to a macro

In four places we use the same logic, so refactor
it to one macro called from four places and avoid
any future oversights missing one.

7 years agooptimise gv.c a bit (we could do better)
Yves Orton [Thu, 27 Oct 2016 18:58:37 +0000 (20:58 +0200)]
optimise gv.c a bit (we could do better)

We save a few ops for package vars starting with 'E'
by checking the second char as well. We could
probably be much smarter with this switch, but we
would have to generate it, which involves its own
issues.

7 years agomust check all the EXPORT vars in two places!
Yves Orton [Thu, 27 Oct 2016 13:36:27 +0000 (15:36 +0200)]
must check all the EXPORT vars in two places!

(Silence lots of used once warnings we used to not generate)

7 years agoregcomp.c: fix perl #129950 - fix firstchar bitmap under utf8 with prefix optimisation
Yves Orton [Thu, 27 Oct 2016 11:52:24 +0000 (13:52 +0200)]
regcomp.c: fix perl #129950 - fix firstchar bitmap under utf8 with prefix optimisation

The trie code contains a number of sub optimisations, one of which
extracts common prefixes from alternations, and another which isa
bitmap of the possible matching first chars.

The bitmap needs to contain the possible first octets of the string
which the trie can match, and for codepoints which might have a different
first octet under utf8 or non-utf8 need to register BOTH codepoints.

So for instance in the pattern (?:a|a\x{E4}) we should restructure this
as a(|\x{E4), and the bitmap for the trie should contain both \x{E4} AND
\x{C3} as \x{C3} is the first byte of \x{EF} expressed as utf8.

7 years agoCarp/t/arg_string.t: fixup to previous fixup
David Mitchell [Thu, 27 Oct 2016 08:29:33 +0000 (09:29 +0100)]
Carp/t/arg_string.t: fixup to previous fixup

I added alternates to a regex for matching a f/p number, but forgot
to put parentheses around them. So it was being ridiculously over-liberal

7 years agoCarp/t/arg_string.t: be liberal in f/p formats
David Mitchell [Thu, 27 Oct 2016 08:09:24 +0000 (09:09 +0100)]
Carp/t/arg_string.t: be liberal in f/p formats

[perl #129954] dist/Carp/t/arg_string.t: Test fails

This test script checks that args are displayed sensibly in longmess()
output, but floating-point numbers can be displayed in various formats
depending on platform, so make the regex more forgiving.

Also add a comment to the top of the script explaining its purpose.

7 years agolocale.c: Silence compiler warning
Karl Williamson [Wed, 26 Oct 2016 18:20:29 +0000 (12:20 -0600)]
locale.c: Silence compiler warning

from some compilers

7 years agolib/locale.t: Skip testing known incompatible locales
Karl Williamson [Mon, 24 Oct 2016 04:03:08 +0000 (22:03 -0600)]
lib/locale.t: Skip testing known incompatible locales

Some locales are incompatible with Perl.  The only multi-byte locales
accepted are UTF-8 ones.  ISO 646 locales can have things like a '|' be
a \w, which will create havoc with regular expressions.  This commit
causes locale.t to not test such locales, and to note which ones are
skipped, and why.

If we were to do the tests anyway, it could create segfaults.  For
example locales with state can have their states screwed up by Perl,
which knows nothing about that.  One could argue that the locale should
be immune from bad state, and not segfault, but that is not under Perl's
control, and we will get blamed initially, anyway, when a segfault
happens, so don't test them.

The multi-byte locales are more incompatible with Perl than the 7-bit
locales that aren't ASCII compatible.  So it could be argued that those
should be tested, but I don't want to undertake the work to separate out
the two causes from each other.  The ISO 646 locales are essentially
obsolete, and hence unlikely to be encountered in practice, so there
would be little pay off for doing that work.

7 years agolib/locale.t: Add skip(), fail() functions
Karl Williamson [Mon, 24 Oct 2016 04:02:13 +0000 (22:02 -0600)]
lib/locale.t: Add skip(), fail() functions

7 years agot/loc_tools.pl: Make find_locales accept string input
Karl Williamson [Tue, 25 Oct 2016 17:10:15 +0000 (11:10 -0600)]
t/loc_tools.pl: Make find_locales accept string input

Prior to this commit, in order to work properly, find_locales required
the C enum number for a locale category.  This relaxes that to allow the
name of the category as well.  Thus it will work seamlessly when a given
category isn't on the platform.  Unless wrapped in an eval, or checked
before using, it was a potential bug to call this function at all.  This
is because it didn't properly handle a string, and trying to find the
locale number might fail on a given platform.

7 years agot/loc_tools.pl: Add 'use strict'
Karl Williamson [Tue, 25 Oct 2016 16:49:01 +0000 (10:49 -0600)]
t/loc_tools.pl: Add 'use strict'

7 years agot/loc_tools.pl: Move some code earlier in the file
Karl Williamson [Mon, 24 Oct 2016 23:45:45 +0000 (17:45 -0600)]
t/loc_tools.pl: Move some code earlier in the file

This is a simple move, with no changes.  This will make things flow more
logically after a future commit.

7 years agot/loc_tools.pl: Complement sense of optional parameter
Karl Williamson [Mon, 24 Oct 2016 03:27:33 +0000 (21:27 -0600)]
t/loc_tools.pl: Complement sense of optional parameter

Most often we want to only look at locales that are compatible with
Perl.  Make that the default for the optional parameter.

7 years agot/loc_tools.pl: Fix not catching incompatible locales
Karl Williamson [Mon, 24 Oct 2016 03:18:20 +0000 (21:18 -0600)]
t/loc_tools.pl: Fix not catching incompatible locales

This is looking for a warning generated by the core when a setlocale is
done to one that it deems incompatible with Perl.  However, the warning
isn't generated unless locales are being used, as Perl mostly ignores
locales, so even if the background one is incompatible, it doesn't
matter.

7 years agoutf8.c: Silence unused parameter compiler warning
Karl Williamson [Wed, 26 Oct 2016 17:02:46 +0000 (11:02 -0600)]
utf8.c: Silence unused parameter compiler warning

7 years agolocale.c: Use meaningful initialization msg
Karl Williamson [Tue, 25 Oct 2016 17:32:38 +0000 (11:32 -0600)]
locale.c: Use meaningful initialization msg

This string is initialized to keep it out of BSS.  It is supposed to be
overwritten by the first call to it.  Use a message that informs the
user if there is a bug and the overwriting doesn't work properly.  This
commit is the result of some freebsd releases that don't properly
implement strlcpy.

7 years agolocale.c: Output warning if debugging and 'no warnings'
Karl Williamson [Wed, 26 Oct 2016 18:09:36 +0000 (12:09 -0600)]
locale.c: Output warning if debugging and 'no warnings'

This message is helpful if called with -DL, even if warnings are off

7 years agoPATCH: [perl #129964] Fix spelling of "referent" in five places.
Andy Lester [Wed, 26 Oct 2016 17:45:12 +0000 (11:45 -0600)]
PATCH: [perl #129964] Fix spelling of "referent" in five places.

7 years agoAdd branch predictors for DEBUG statements
Karl Williamson [Tue, 25 Oct 2016 16:47:23 +0000 (10:47 -0600)]
Add branch predictors for DEBUG statements

It is unlikely that any given debug flag will be set in any given run,
even under DEBUGGING builds.

7 years agoperl.h: White-space only
Karl Williamson [Tue, 25 Oct 2016 16:46:42 +0000 (10:46 -0600)]
perl.h: White-space only

7 years agopod/perllocale: Add caution about incompatible locales
Karl Williamson [Mon, 24 Oct 2016 04:12:12 +0000 (22:12 -0600)]
pod/perllocale: Add caution about incompatible locales

Some locales aren't compatible with Perl.  Note the potential bad
consequences of using them.

7 years agoPATCH: [perl #129277] perlrecharclass: Clarify q// handling
Karl Williamson [Fri, 16 Sep 2016 03:52:44 +0000 (21:52 -0600)]
PATCH: [perl #129277] perlrecharclass: Clarify q// handling

See https://rt.perl.org/Ticket/Display.html?id=129277

7 years ago-DsR : display unTEMPed temps with "t" not "T"
David Mitchell [Wed, 26 Oct 2016 16:48:44 +0000 (17:48 +0100)]
-DsR : display unTEMPed temps with "t" not "T"

with the -R debugging flag, SVs are displayed with a reference count
(if > 1), and with a T if the SV is referenced from the temps stack.

E.g.
    $ perl -DstR -e'@a = map $_,"a", "b"'
    ...
    *  <T>PV("a"\0)  <T>PV("b"\0)

This commit enhances this to use both "t" and "T":

t:  SV is referenced from PL_tmps_stack, but SvTEMP() not set
T:  SV is referenced from PL_tmps_stack, and in addition, SvTEMP() is set

(The other permutation,  SvTEMP() set but not in PL_tmps_stack, is
illegal).

This commit changes