This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
4 years agolibperl.t: treat i686 arch the same as x86
Lukas Mai [Thu, 20 Oct 2016 10:57:39 +0000 (12:57 +0200)]
libperl.t: treat i686 arch the same as x86

4 years agotoke.c: remove redundant (OP *) casts
Lukas Mai [Sun, 16 Oct 2016 01:14:07 +0000 (03:14 +0200)]
toke.c: remove redundant (OP *) casts

4 years agotoke.c: get rid of "if (0)"
Lukas Mai [Sun, 16 Oct 2016 01:03:23 +0000 (03:03 +0200)]
toke.c: get rid of "if (0)"

4 years agoutf8n_to_uvchr(): Reduce chances of reading beyond buffer
Karl Williamson [Thu, 20 Oct 2016 03:20:48 +0000 (21:20 -0600)]
utf8n_to_uvchr(): Reduce chances of reading beyond buffer

utf8n_to_uvchr() can be called incorrectly, leading it to believe the
buffer is longer than it actually is.  But often, it will be called with
NUL terminated strings, so it can reduce it's chances of being fooled by
refusing to read beyond a NUL.  The NUL will terminate any UTF-8 byte
sequence, and the only reason to read beyond it would be to print all
the expected bytes in the sequence.

This commit is not the final word, but it is an easy fix for a common
case.

4 years agopodcheck.t: .core dump files don't contain pod
Karl Williamson [Thu, 20 Oct 2016 00:43:39 +0000 (18:43 -0600)]
podcheck.t: .core dump files don't contain pod

even if they have pod lines in them.

4 years agomake regen and args assert fix
Yves Orton [Wed, 19 Oct 2016 20:54:15 +0000 (22:54 +0200)]
make regen and args assert fix

4 years agoAdd a way to have functions with a trailing depth argument under debugging
Yves Orton [Wed, 19 Oct 2016 20:44:45 +0000 (22:44 +0200)]
Add a way to have functions with a trailing depth argument under debugging

In the regex engine it can be useful in debugging mode to
maintain a depth counter, but in normal mode this argument
would be unused. This allows us to define functions in embed.fnc
with a "W" flag which use _pDEPTH and _aDEPTH defines which
effectively define/pass through a U32 depth parameter to the
macro wrappers. These defines are similar to the existing
aTHX and pTHX parameters.

4 years agomark depth unused except under DEBUGGING
Yves Orton [Wed, 19 Oct 2016 19:33:00 +0000 (21:33 +0200)]
mark depth unused except under DEBUGGING

4 years agoPATCH: [perl #129322] S_invlist_clear(SV *): Assertion `invlist' failed
Karl Williamson [Mon, 17 Oct 2016 21:08:08 +0000 (15:08 -0600)]
PATCH: [perl #129322] S_invlist_clear(SV *): Assertion `invlist' failed

This was the result of an inconsistency in the inversion list union and
intersection routines, where under some conditions the function returned
a new inversion list, and under other conditions it just changed one of
the input ones.  The caller knew about one of those and compensated, but
that compensation was erroneous given other conditions.  This violated
encapsulation.  The fix is make the called functions always consistent.

4 years agoregcomp.c: Fix erroneous comment; clarify others
Karl Williamson [Sat, 15 Oct 2016 16:30:08 +0000 (10:30 -0600)]
regcomp.c: Fix erroneous comment; clarify others

4 years agoAdd a regex_sets debugging function
Karl Williamson [Wed, 31 Aug 2016 23:52:19 +0000 (17:52 -0600)]
Add a regex_sets debugging function

This is enabled by a C flag, as commented.  It is designed to be found
only by someone reading the code and wanting something temporary to help
in debugging.

4 years agoPerlIO_printf() does not take aTHX_ as an argument
Yves Orton [Wed, 19 Oct 2016 15:25:40 +0000 (17:25 +0200)]
PerlIO_printf() does not take aTHX_ as an argument

and if you use it, you can build fine on unthreaded perl, but
threaded will blow up. Sigh.

4 years agot/regop.t: improve test name
Yves Orton [Wed, 19 Oct 2016 15:15:44 +0000 (17:15 +0200)]
t/regop.t: improve test name

4 years agoregcomp.c: remove extra aTHX_ added in c2867e745ca
Lukas Mai [Wed, 19 Oct 2016 13:17:04 +0000 (15:17 +0200)]
regcomp.c: remove extra aTHX_ added in c2867e745ca

4 years agopp_(hot|ctl).c: switch croak() to Perl_croak() for win32
Yves Orton [Wed, 19 Oct 2016 12:35:16 +0000 (14:35 +0200)]
pp_(hot|ctl).c: switch croak() to Perl_croak() for win32

4 years agoregexec.c: fix #129903: forbid empty pattern in regex code block
Yves Orton [Tue, 18 Oct 2016 11:11:49 +0000 (13:11 +0200)]
regexec.c: fix #129903: forbid empty pattern in regex code block

PL_curpm provides access to the data needed to implement
the regex magic vars like $1 and $&. These vars are defined
to reference the last successfully matched pattern, or when
in regex code blocks (?{ ... }) and (??{ ... }), they
should refer to the currently executing pattern.

Unfortunately this collides with its use to implement the
empty pattern special behavior, which requires /just/
"the last successfully matched pattern" everwhere.

This meant that a pattern match like /(?{ s!!! })/ will
infinitely recurse. Fixing this would be difficult, on
the other hand detecting it is not, so we can convert
the infinite recursion/stack overflow into a normal
exception.

4 years agoregexec.c: add comment and add a test
Yves Orton [Mon, 17 Oct 2016 21:13:44 +0000 (23:13 +0200)]
regexec.c: add comment and add a test

The test is from the existing comment.

4 years agoregexec.c: fixup annoying unbalanced whitespace
Yves Orton [Mon, 17 Oct 2016 21:13:16 +0000 (23:13 +0200)]
regexec.c: fixup annoying unbalanced whitespace

4 years agoregexec.c: in debug fixup indents and TRIE/BUFFER debug output
Yves Orton [Mon, 17 Oct 2016 21:12:24 +0000 (23:12 +0200)]
regexec.c: in debug fixup indents and TRIE/BUFFER debug output

4 years agoregexec.c: in debug show whether TRIE nodes have a jump table
Yves Orton [Mon, 17 Oct 2016 21:10:10 +0000 (23:10 +0200)]
regexec.c: in debug show whether TRIE nodes have a jump table

4 years agoregexec.c: fix perl #129897: trie short circuit breaks capture buffers
Yves Orton [Mon, 17 Oct 2016 21:09:11 +0000 (23:09 +0200)]
regexec.c: fix perl #129897: trie short circuit breaks capture buffers

There is an optimisation when a trie matches only one thing
which causes it to fall through to the following code without
setting up a stack unwind frame. This breaks if we are using
a trie jump table where we might change state that will need
to be unwound on failure.

4 years agovxs.inc: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:27 +0000 (11:14 +0200)]
vxs.inc: use new SvPVCLEAR and constant string friendly macros

4 years agovutil.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:27 +0000 (11:14 +0200)]
vutil.c: use new SvPVCLEAR and constant string friendly macros

4 years agoutf8.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:27 +0000 (11:14 +0200)]
utf8.c: use new SvPVCLEAR and constant string friendly macros

4 years agouniversal.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:27 +0000 (11:14 +0200)]
universal.c: use new SvPVCLEAR and constant string friendly macros

4 years agotoke.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:27 +0000 (11:14 +0200)]
toke.c: use new SvPVCLEAR and constant string friendly macros

4 years agosv.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:27 +0000 (11:14 +0200)]
sv.c: use new SvPVCLEAR and constant string friendly macros

4 years agoregcomp.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:26 +0000 (11:14 +0200)]
regcomp.c: use new SvPVCLEAR and constant string friendly macros

4 years agopp_sys.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:26 +0000 (11:14 +0200)]
pp_sys.c: use new SvPVCLEAR and constant string friendly macros

4 years agopp_pack.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:26 +0000 (11:14 +0200)]
pp_pack.c: use new SvPVCLEAR and constant string friendly macros

4 years agopp_hot.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:26 +0000 (11:14 +0200)]
pp_hot.c: use new SvPVCLEAR and constant string friendly macros

4 years agopp_ctl.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:26 +0000 (11:14 +0200)]
pp_ctl.c: use new SvPVCLEAR and constant string friendly macros

4 years agopp.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:26 +0000 (11:14 +0200)]
pp.c: use new SvPVCLEAR and constant string friendly macros

4 years agoop.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:26 +0000 (11:14 +0200)]
op.c: use new SvPVCLEAR and constant string friendly macros

4 years agonumeric.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:26 +0000 (11:14 +0200)]
numeric.c: use new SvPVCLEAR and constant string friendly macros

4 years agomro_core.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:26 +0000 (11:14 +0200)]
mro_core.c: use new SvPVCLEAR and constant string friendly macros

4 years agomg.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:26 +0000 (11:14 +0200)]
mg.c: use new SvPVCLEAR and constant string friendly macros

4 years agolocale.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:26 +0000 (11:14 +0200)]
locale.c: use new SvPVCLEAR and constant string friendly macros

4 years agohv.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:26 +0000 (11:14 +0200)]
hv.c: use new SvPVCLEAR and constant string friendly macros

4 years agodump.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:26 +0000 (11:14 +0200)]
dump.c: use new SvPVCLEAR and constant string friendly macros

4 years agodoop.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:25 +0000 (11:14 +0200)]
doop.c: use new SvPVCLEAR and constant string friendly macros

4 years agodoio.c: use new SvPVCLEAR and constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 09:14:25 +0000 (11:14 +0200)]
doio.c: use new SvPVCLEAR and constant string friendly macros

4 years agogv.c: rework special var matching logic to be simpler
Yves Orton [Wed, 19 Oct 2016 09:09:00 +0000 (11:09 +0200)]
gv.c: rework special var matching logic to be simpler

The old code used a bunch of tricks that IMO are unlikely
to actually make any performance difference, and make
the code harder to read, search, and understand, and less
amenable to using string constant friendly macros.

So for instance instead of switching on the first char
and then comparing the second on for an exact match
instead just compare the full string. The extra char
is unlikely to make a difference to the underlying code
that gets called, and the end result is easier searching.

Another issue is that some of the code was inadverdantly
doing prefix matches, and not exact matchs for certain
magic var names. This is fixed as part of these changes.

4 years agogv.c: rework string separator parsing to use new string macros
Yves Orton [Wed, 19 Oct 2016 09:08:10 +0000 (11:08 +0200)]
gv.c: rework string separator parsing to use new string macros

4 years agogv.c: switch to using string constant friendly macros
Yves Orton [Wed, 19 Oct 2016 09:07:40 +0000 (11:07 +0200)]
gv.c: switch to using string constant friendly macros

4 years agogv.c: add a require_tie_mod_s() wrapper for constant string args
Yves Orton [Wed, 19 Oct 2016 09:06:26 +0000 (11:06 +0200)]
gv.c: add a require_tie_mod_s() wrapper for constant string args

4 years agoperl.[ch]: switch to using SvPVCLEAR() and string constant friendly macros
Yves Orton [Wed, 19 Oct 2016 09:01:08 +0000 (11:01 +0200)]
perl.[ch]: switch to using SvPVCLEAR() and string constant friendly macros

4 years agovms: use hv_fetchs() with constant string key
Yves Orton [Wed, 19 Oct 2016 08:59:06 +0000 (10:59 +0200)]
vms: use hv_fetchs() with constant string key

4 years agopod: mention SvPVCLEAR()
Yves Orton [Wed, 19 Oct 2016 08:58:30 +0000 (10:58 +0200)]
pod: mention SvPVCLEAR()

4 years agoamigaos4: use constant string friendly macros
Yves Orton [Wed, 19 Oct 2016 08:56:44 +0000 (10:56 +0200)]
amigaos4: use constant string friendly macros

4 years agodist/Data-Dumper: switch to using SvPVCLEAR()
Yves Orton [Wed, 19 Oct 2016 08:56:00 +0000 (10:56 +0200)]
dist/Data-Dumper: switch to using SvPVCLEAR()

4 years agoStorable: switch to using SvPVCLEAR()
Yves Orton [Wed, 19 Oct 2016 08:55:40 +0000 (10:55 +0200)]
Storable: switch to using SvPVCLEAR()

4 years agoos2: switch to using string constant friendly macros
Yves Orton [Wed, 19 Oct 2016 08:54:54 +0000 (10:54 +0200)]
os2: switch to using string constant friendly macros

4 years agoext/XS-APItest: switch to using strEQs()
Yves Orton [Wed, 19 Oct 2016 08:54:05 +0000 (10:54 +0200)]
ext/XS-APItest: switch to using strEQs()

this could use further love, and switch to using memEQs()
in many places.

4 years agoext/mro: use memEQs() for constant string checks
Yves Orton [Wed, 19 Oct 2016 08:52:28 +0000 (10:52 +0200)]
ext/mro: use memEQs() for constant string checks

4 years agoext/PerlIO-encoding: use SvPVCLEAR()
Yves Orton [Wed, 19 Oct 2016 08:50:58 +0000 (10:50 +0200)]
ext/PerlIO-encoding: use SvPVCLEAR()

4 years agoext/POSIX: use _memEQs() and not memEQ() for constant string comparison
Yves Orton [Wed, 19 Oct 2016 08:50:19 +0000 (10:50 +0200)]
ext/POSIX: use _memEQs() and not memEQ() for constant string comparison

4 years agoext/B: use strEQs() and strEQ() in expressions
Yves Orton [Wed, 19 Oct 2016 08:49:40 +0000 (10:49 +0200)]
ext/B: use strEQs() and strEQ() in expressions

4 years agoext/VMS-Stdio: switch to using macros designed for string constant args
Yves Orton [Wed, 19 Oct 2016 08:48:21 +0000 (10:48 +0200)]
ext/VMS-Stdio: switch to using macros designed for string constant args

4 years agoext/attributes: use _memEQs() when comparing to string arguments
Yves Orton [Wed, 19 Oct 2016 08:47:01 +0000 (10:47 +0200)]
ext/attributes: use _memEQs() when comparing to string arguments

4 years agoDevel-Peek: use hv_fetchs() when the key is a constant string
Yves Orton [Wed, 19 Oct 2016 08:44:53 +0000 (10:44 +0200)]
Devel-Peek: use hv_fetchs() when the key is a constant string

4 years agosv.c: add sv_setpv_bufsize() and SvPVCLEAR()
Yves Orton [Wed, 19 Oct 2016 08:40:29 +0000 (10:40 +0200)]
sv.c: add sv_setpv_bufsize() and SvPVCLEAR()

The first can be used to wrap several SVPV steps into
a single sub, and a wrapper macro which is the equivalent
of

   $s= "";

but is optimized in various ways.

4 years agohandy.h, hv.h: fixup hash s suffix macro definitions, move to hv.h
Yves Orton [Wed, 19 Oct 2016 08:36:14 +0000 (10:36 +0200)]
handy.h, hv.h: fixup hash s suffix macro definitions, move to hv.h

For some reason s suffix macro definitions intended for handling
constant string arguments were put into handy.h and not into hv.h.

I think this is wrong, especially as the macro defintions have
"drifted" and are not properly defined in terms the right base
macros.

Also we want to have such wrappers for the main hash functions,
so move them all to hv.h, recode them properly in terms of the
right base macros, and add support for the missing functions.

4 years agohandy.h: add _memEQs() and _memNEs() for use with constant strings
Yves Orton [Wed, 19 Oct 2016 08:32:29 +0000 (10:32 +0200)]
handy.h: add _memEQs() and _memNEs() for use with constant strings

memEQs() is already defined, and requires a length parameter for
the first pointer argument. However some times we do not have
this length handy and simply want to use the length of the constant
string instead.

In an ideal world, to be compatible with more s suffix macros,
IMO the existing memEQs() should have been called something like
memEQsl() maybe, and the ones I am adding would get the memEQs(
name, but it didnt work out like that.

4 years agohandy.h: add strEQs() and strNEs() for comparing to constant strings
Yves Orton [Wed, 19 Oct 2016 08:30:44 +0000 (10:30 +0200)]
handy.h: add strEQs() and strNEs() for comparing to constant strings

They use strncmp() and derive the length using STR_WITH_LEN style
tricks in the wrapper call.

4 years agogv.c: document where @- and @+ (and %- and %+ are initialized in gv.c)
Yves Orton [Thu, 13 Oct 2016 16:41:00 +0000 (18:41 +0200)]
gv.c: document where @- and @+ (and %- and %+ are initialized in gv.c)

4 years agouniprops.t: split into 10 seperate test files t/re/uniprops01.t etc
Yves Orton [Wed, 19 Oct 2016 07:52:01 +0000 (09:52 +0200)]
uniprops.t: split into 10 seperate test files t/re/uniprops01.t etc

This way we can run them at the same time under parallel test,
as there are a lot of tests (140k or so) this makes a difference.

4 years agoPATCH: [perl #129766] Internal cleanup in numeric.c
Andy Lester [Fri, 30 Sep 2016 16:20:47 +0000 (10:20 -0600)]
PATCH: [perl #129766] Internal cleanup in numeric.c

No functional changes

4 years agoUpdate Net-Ping to CPAN version 2.51
Chris 'BinGOs' Williams [Tue, 18 Oct 2016 10:14:18 +0000 (11:14 +0100)]
Update Net-Ping to CPAN version 2.51

  [DELTA]

2.51  Mon Oct 17 16:11:03 2016 +0200 (rurban)
       version in cperl since 5.25.2c

       Bugfixes
       - Fixed missing _unpack_sockaddr_in family, which took AF_INET6 for
         a AF_INET addr in t/500_ping_icmp.t and t/500_ping_icmp_ttl.t.
         Use now a proper default.

2.50  Sat Apr 16 11:50:20 2016 +0200 (rurban)
       version in cperl since 5.22.2c

       Features
       - Handle IPv6 addresses and the AF_INET6 family.
       - Added the optional family argument to most methods.
         valid values: 6, "v6", "ip6", "ipv6", AF_INET6
       - new can take now named arguments, a hashref.
       - Added the following named arguments to new:
         gateway host port bind retrans pingstring source_verify econnrefused
         IPV6_USE_MIN_MTU IPV6_RECVPATHMTU IPV6_HOPLIMIT
       - Added a dontfrag option, setting IP_DONTFRAG and on linux
         also IP_MTU_DISCOVER to IP_PMTUDISC_DO. Note that is ignored if
         Socket does not export IP_DONTFRAG.
       - Added the wakeonlan method
       - Improve argument default handling
       - Added missing documentation

       Bugfixes
       - Reapply tos with ping_udp, when the address is changed.
         RT #6706 (Torgny.Hofstedt@sevenlevels.se)
         ditto re-bind to a device.

       Internals
       - $ip is now a hash with {addr, addr_in, family} not the addr_in packed IP.
       - added _resolv replacing inet_aton,
         _pack_sockaddr_in and _unpack_sockaddr_in replacing sockaddr_in,
         _inet_ntoa replacing inet_ntoa
       - Use _isroot helper, with Win32 _IsAdminUser helper.
       - added several new tests (Steve Peters)

2.43  Mon Apr 29 00:23:56 2013 -0300
        version in perl core since 5.19.9
        Bugfixes
        - Handle getprotobyn{ame,umber} not being available
2.42  Sun May 26 19:08:46 2013 -0700
        version in perl core since 5.19.1
        Bugfixes
        - Stabilize tests
       Internals
        - wrap long pod lines

4 years agoUpdate Archive-Tar to CPAN version 2.12
Chris 'BinGOs' Williams [Tue, 18 Oct 2016 09:10:41 +0000 (10:10 +0100)]
Update Archive-Tar to CPAN version 2.12

  [DELTA]

2.12  16/10/2016 (KHW && JKEENAN)
- Fix pod in bin/ptar
- Distinguish between archives with/without directory entries

4 years agoutf8.c: Reflow 2 lines, so it is clear they are 2.
Karl Williamson [Tue, 18 Oct 2016 02:35:36 +0000 (20:35 -0600)]
utf8.c: Reflow 2 lines, so it is clear they are 2.

THis caused some confusion, see
<2B6CE3F8-B566-4581-B7E3-815C45F37E04@petdance.com>
so I reflowed things.

4 years agoop.c: Fix EBCDIC-only bug
Karl Williamson [Tue, 18 Oct 2016 02:16:21 +0000 (20:16 -0600)]
op.c: Fix EBCDIC-only bug

We have no tests that this fails for, but on an EBCDIC machine, the
branches here are incorrect.  They are trying to determine if a UTF-8
representation will be larger than a non-UTF-8 representation for code
points < 256.  The proper test is if the code points are UTF-8
invariant.

4 years agotoke.c: Fix EBCDIC issue
Karl Williamson [Fri, 19 Aug 2016 03:13:04 +0000 (21:13 -0600)]
toke.c: Fix EBCDIC issue

The value here is Unicode, not native, so needs a different macro.
There's no test for this, as this is allocating space, and could be one
byte off, which is only a problem if it is one byte small, and we were
at a limit where that single byte made the difference.

4 years agoperlapi: Grammar, typos
Karl Williamson [Thu, 18 Aug 2016 23:57:14 +0000 (17:57 -0600)]
perlapi: Grammar, typos

4 years agotoke.c: Fix grammar in comment
Karl Williamson [Wed, 17 Aug 2016 21:22:50 +0000 (15:22 -0600)]
toke.c: Fix grammar in comment

4 years agomake regen for the IBM/CRAY fp
Jarkko Hietaniemi [Mon, 17 Oct 2016 21:55:26 +0000 (17:55 -0400)]
make regen for the IBM/CRAY fp

4 years agoAdd scan for IBM and Cray mainframe fp formats.
Jarkko Hietaniemi [Mon, 17 Oct 2016 12:29:35 +0000 (08:29 -0400)]
Add scan for IBM and Cray mainframe fp formats.

For completeness: it's quite unlikely Perl would build in those
environments.

Though with Cray it's less impossible: Perl used to build in C90
UNICOS, in 5.8-ish timeframe.

With IBM, highly unlikely, because there probably never was a UNIXy
enough environment where the IBM Floating Point Architecture was used.

4 years ago(perl #128996) prevent PL_op pointing to freed ops
Tony Cook [Mon, 17 Oct 2016 03:32:41 +0000 (14:32 +1100)]
(perl #128996) prevent PL_op pointing to freed ops

When yylex() attempts to report a UTF-8 encoding error, it
indirectly accesses PL_op, this would cause an access to freed
memory if the CV containing that op (and the op itself) had been
freed.

4 years agoAdd script for looking at test time outliers.
Jarkko Hietaniemi [Sun, 16 Oct 2016 19:26:36 +0000 (15:26 -0400)]
Add script for looking at test time outliers.

Requires logging the output of "make test" with HARNESS_TIMER=1

4 years agonetbsd/vax perldelta tweakery.
Jarkko Hietaniemi [Sun, 16 Oct 2016 19:12:29 +0000 (15:12 -0400)]
netbsd/vax perldelta tweakery.

4 years agomacOS Sierra (10.12) does have clockid_t.
Jarkko Hietaniemi [Sun, 16 Oct 2016 20:33:23 +0000 (16:33 -0400)]
macOS Sierra (10.12) does have clockid_t.

Scan for it in all platforms.

4 years agoPATCH: [perl #129891] t/op/utf8decode.t failing
Karl Williamson [Sat, 15 Oct 2016 17:02:04 +0000 (11:02 -0600)]
PATCH: [perl #129891] t/op/utf8decode.t failing

This bug is a result of 32-bit vs 64-bit words, and is a problem in the
test file and not the underlying code.

The blamed commit changed things so that is a UTF-8 sequence has
multiple malformations, a diagnostic is generated for each.  Some of the
tests in utf8decode.t overflow on 32-bit words, but not 64.  The
solution is to change the .t to also look for the extra overflow
warnings on 32 bit machines.

4 years agoutf8.c: Silence a compiler warning
Karl Williamson [Sat, 15 Oct 2016 17:00:57 +0000 (11:00 -0600)]
utf8.c: Silence a compiler warning

Some compilers wrongly warn that this is used uninitialized.

4 years agoperldelta: draft for commits up to 877b982928
Aaron Crane [Sun, 16 Oct 2016 13:12:42 +0000 (14:12 +0100)]
perldelta: draft for commits up to 877b982928

4 years agoMove perldelta entry to correct section
Aaron Crane [Sun, 16 Oct 2016 12:58:52 +0000 (13:58 +0100)]
Move perldelta entry to correct section

4 years ago[RT #129789] Time::HiRes: fix compilation on darwin
Sergey Aleynikov [Wed, 5 Oct 2016 15:29:34 +0000 (18:29 +0300)]
[RT #129789] Time::HiRes: fix compilation on darwin

Commit 1c5665476f0d7250c7d93f82eab2b7cda1e6937f added explicit cast
for one of the clock_gettime() arguments, but darwin lacks clockid_t,
so update emulation layer to match function prototype too.

4 years agoIf a unit test doesn't finish in 5 minutes, it's not a unit test.
Jarkko Hietaniemi [Fri, 14 Oct 2016 02:04:20 +0000 (22:04 -0400)]
If a unit test doesn't finish in 5 minutes, it's not a unit test.

These tests seem to often be outliers in execution time.  In faster
modern machines the slowness is not noticeable, but in slower machines
these are excruciatingly slow.

In slow machines these tests may grind for hours, but that is not
that useful information.  We know the machine is slow, already.

The uniprops.t could also use the watchdog, except that TestProp.pl
seems to be purposefully avoiding using test.pl.

4 years agoperlsec: convert C snippet from K&R C to C89
Lukas Mai [Fri, 14 Oct 2016 11:21:33 +0000 (13:21 +0200)]
perlsec: convert C snippet from K&R C to C89

Also include required headers and report errors on failure.

(Inspired by afoken's post at <http://perlmonks.org/?node_id=1173959>.)

4 years agoperlapi: Fix clause that should have been removed earlier
Karl Williamson [Thu, 13 Oct 2016 01:14:13 +0000 (19:14 -0600)]
perlapi: Fix clause that should have been removed earlier

4 years agoutf8.h: Simplify macro
Karl Williamson [Thu, 13 Oct 2016 01:12:11 +0000 (19:12 -0600)]
utf8.h: Simplify macro

This complicated macro boils down to just one bit.

4 years agoAdd utf8n_to_uvchr_error
Karl Williamson [Tue, 11 Oct 2016 03:18:37 +0000 (21:18 -0600)]
Add utf8n_to_uvchr_error

This new function behaves like utf8n_to_uvchr(), but takes an extra
parameter that points to a U32 which will be set to 0 if no errors are
found; otherwise each error found will set a bit in it.  This can be
used by the caller to figure out precisely what the error(s) is/are.
Previously, one would have to capture and parse the warning/error
messages raised.   This can be used, for example, to customize the
messages to the expected end-user's knowledge level.

4 years agoutf8n_to_uvchr(): Make a parameter const
Karl Williamson [Sun, 9 Oct 2016 03:19:18 +0000 (21:19 -0600)]
utf8n_to_uvchr(): Make a parameter const

4 years agoutf8n_to_uvchr(): Note multiple malformations
Karl Williamson [Thu, 6 Oct 2016 01:09:02 +0000 (19:09 -0600)]
utf8n_to_uvchr(): Note multiple malformations

Some UTF-8 sequences can have multiple malformations.  For example, a
sequence can be the start of an overlong representation of a code point,
and still be incomplete.  Until this commit what was generally done was
to stop looking when the first malformation was found.  This was not
correct behavior, as that malformation may be allowed, while another
unallowed one went unnoticed.  (But this did not actually create
security holes, as those allowed malformations replaced the input with a
REPLACEMENT CHARACTER.)  This commit refactors the error handling of
this function to set a flag and keep going if a malformation is found
that doesn't preclude others.  Then each is handled in a loop at the
end, warning if warranted.  The result is that there is a warning for
each malformation for which warnings should be generated, and an error
return is made if any one is disallowed.

Overflow doesn't happen except for very high code points, well above the
Unicode range, and above fitting in 31 bits.  Hence the latter 2
potential malformations are subsets of overflow, so only one warning is
output--the most dire.

This will speed up the normal case slightly, as the test for overflow is
pulled out of the loop, allowing the UV to overflow.  Then a single test
after the loop is done to see if there was overflow or not.

4 years agoAPItest/t/utf8.t: Indent a bunch of code
Karl Williamson [Fri, 7 Oct 2016 21:07:57 +0000 (15:07 -0600)]
APItest/t/utf8.t: Indent a bunch of code

And reflow to fit in 80 columns.  This is in preparation for the next
commit which will enlocde this new code with two more for loops.
Several lines that were missing semi-colons have these added (they were
at the end of nested blocks, so it wasn't an error)

4 years agoAPItest/t/utf8.t: Fix improper tests
Karl Williamson [Sun, 9 Oct 2016 02:53:31 +0000 (20:53 -0600)]
APItest/t/utf8.t: Fix improper tests

These two tests are overlong malformations, besides being the ones
purportedly being tested.  Make them not overlong, so are testing just
one thing

4 years agoAPItest/t/utf8.t: Add missing test
Karl Williamson [Thu, 6 Oct 2016 00:34:15 +0000 (18:34 -0600)]
APItest/t/utf8.t: Add missing test

Under some circumstances we weren't validating that the generated
warnings are correct.  This required reordering some 'if' tests, and
revised special casing of the overflow test.

4 years agoAPItest/t/utf8.t: Rename test for clarity
Karl Williamson [Thu, 6 Oct 2016 00:32:55 +0000 (18:32 -0600)]
APItest/t/utf8.t: Rename test for clarity

4 years agoutf8.c: Extract some code into 2 functions
Karl Williamson [Mon, 3 Oct 2016 03:50:10 +0000 (21:50 -0600)]
utf8.c: Extract some code into 2 functions

This is in preparation for the same functionality to each be used in a
new place in a future commit

4 years agoutf8.c: Rename a couple of macros for clarity
Karl Williamson [Mon, 3 Oct 2016 03:31:52 +0000 (21:31 -0600)]
utf8.c: Rename a couple of macros for clarity

These were recently added in 2b47960981adadbe81b9635d4ca7861c45ccdced.
This also removes the #undefs of these in preparation for them to be
used later in the file.

4 years agoutf8.h: Change some flag definition constants
Karl Williamson [Mon, 3 Oct 2016 03:09:27 +0000 (21:09 -0600)]
utf8.h: Change some flag definition constants

These #defines give flag bits in a U32.  This commit opens a gap that
will be filled in a future commit.  A test file has to change to
correspond, as it duplicates the defines.