This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
6 years ago[perl #132527] Allow 4-arg substr(delete ...)
Father Chrysostomos [Sat, 2 Dec 2017 02:47:58 +0000 (18:47 -0800)]
[perl #132527] Allow 4-arg substr(delete ...)

Commit 19a8de4862 broke 4-arg substr with ‘delete’ (and various other
ops) for its first argument.  Since historically these have been
allowed, use a ‘loose’ lvalue context such as entersub when lvaluify-
ing the first argument.

6 years agot/lib/warnings/9enabled: update comment
Father Chrysostomos [Mon, 27 Nov 2017 02:46:56 +0000 (18:46 -0800)]
t/lib/warnings/9enabled: update comment

This new description of the file better reflecst what it is actually
used for now.

6 years agofixup test that was broken by 3c67ad9b9.
Yves Orton [Fri, 1 Dec 2017 20:00:05 +0000 (21:00 +0100)]
fixup test that was broken by 3c67ad9b9.

Error message changed from "Can't" to "Cannot" with slightly different
wording, breaking t/run/switches.t

6 years agocomment entry points to study_chunk
Yves Orton [Fri, 1 Dec 2017 18:35:02 +0000 (19:35 +0100)]
comment entry points to study_chunk

so it is a bit easier to follow what they are used for.

6 years agocomment out unreachable code and explain why it was/is there
Yves Orton [Fri, 1 Dec 2017 18:32:46 +0000 (19:32 +0100)]
comment out unreachable code and explain why it was/is there

6 years agoSpecify afs entries in configure.com.
Craig A. Berry [Fri, 1 Dec 2017 17:45:50 +0000 (11:45 -0600)]
Specify afs entries in configure.com.

This prevents op/stat.t from failing due to an undefined variable
warning when $Config{'afsroot'} is checked.

6 years agoin Data-Dumper, quote glob names better
Zefram [Fri, 1 Dec 2017 17:35:35 +0000 (17:35 +0000)]
in Data-Dumper, quote glob names better

Glob name quoting should obey Useqq.  Fixes [perl #119831].

6 years ago(perl #132506) finish the correction to dir_unchanged()
Tony Cook [Fri, 1 Dec 2017 03:36:52 +0000 (14:36 +1100)]
(perl #132506) finish the correction to dir_unchanged()

and adjust the error message for renaming the work file

6 years agocorrect a perldelta description
Zefram [Fri, 1 Dec 2017 02:10:33 +0000 (02:10 +0000)]
correct a perldelta description

The threshold for size computation problems in malloc() is a bit smaller
than the description initially indicated.

6 years agorevert changes to st_ino signedness handling
Zefram [Fri, 1 Dec 2017 01:39:57 +0000 (01:39 +0000)]
revert changes to st_ino signedness handling

This reverts commits 8843856e9716655549cce789b3338e1d4c72fffb,
3676f9e77d46b61f4785aad171f02bed29df0c07, and
793c2ded15ca832d1df1fabbc3b2e7562a057697.

As noted in the large comment above the relevant code, the probed
ST_INO_SIGN is not reliable enough for its purpose, because Configure
makes guesses.  The actual compiler knows whether st_ino is signed,
and is perfectly capable of optimising out the negative-handling code
in the usual case that st_ino is unsigned, without any need for us to
preprocess it away.

6 years agoin malloc, compute memory sizes in size_t
Zefram [Fri, 1 Dec 2017 01:25:52 +0000 (01:25 +0000)]
in malloc, compute memory sizes in size_t

Some size computations were using the wrong data type, in particular
getting a signed 32-bit type where unsigned 64-bit is required on
LP64 systems.  That resulted in truncation and in sign extension during
later conversion to the correct type, either way producing bogus sizes.
Fix by casting everything to size_t suitably early.  Fixes [perl #119829].

6 years agoperluniprops: Display controls sorted by alpha
Karl Williamson [Thu, 30 Nov 2017 20:47:30 +0000 (13:47 -0700)]
perluniprops: Display controls sorted by alpha

The complete set of C0 controls is listed by standard abbreviation, but
it is better to display them alphabetically, and not in ASCII-platform
code point order.

6 years agomktables: Add safety code
Karl Williamson [Thu, 30 Nov 2017 20:31:52 +0000 (13:31 -0700)]
mktables: Add safety code

This isn't currently necessary to add, but I discovered this deficiency
during debugging, and it could come up in some later change.

This code only writes one file when two tables match identically.  But
it could happen that we've got the pointers to the two tables
intertwined so that they each think the other one is the one getting
written out, so neither of them do.  This checks for that.

6 years agoperluniprops: Make sc property refer to scx
Karl Williamson [Thu, 30 Nov 2017 20:18:18 +0000 (13:18 -0700)]
perluniprops: Make sc property refer to scx

The scx is an improved version of the sc(ript) property.  This changes
mktables to generate perluniprops so that the entries for sc tables
refer to the equivalent scx ones.

6 years agoperluniprops/mktables: Fix bad entry
Karl Williamson [Thu, 30 Nov 2017 19:59:39 +0000 (12:59 -0700)]
perluniprops/mktables: Fix bad entry

I spotted this entry in perluniprops recently:

   \p{Nko}                 \p{Script_Extensions=Nko} (NOT \p{NKo})

It's saying Nko is not NKo.  But case isn't supposed to matter.  It
turned out that the bug was doing an eq without first canonicalizing the
names to account for case differences.  I was expecting there to be more
entries that were erroneous, but it was just this one.

6 years agomktables: Comment fixes only
Karl Williamson [Thu, 30 Nov 2017 19:51:43 +0000 (12:51 -0700)]
mktables: Comment fixes only

6 years agomktables: Use global for Script_Extensions object
Karl Williamson [Thu, 30 Nov 2017 19:38:34 +0000 (12:38 -0700)]
mktables: Use global for Script_Extensions object

This is used in several places, so make its scope global to the program.

6 years agoperluniprops: \p{Greek} is a shortcut for scx:greek
Karl Williamson [Thu, 30 Nov 2017 03:42:25 +0000 (20:42 -0700)]
perluniprops: \p{Greek} is a shortcut for scx:greek

Since 5.26.0, this (generated) pod has been wrong.  The single-form Perl
shortcuts for script names now use the Script_Extensions property
instead of the (inferior) plain Script property.

6 years agoTry harder to define INT64_C and UINT64_C.
Craig A. Berry [Thu, 30 Nov 2017 15:07:57 +0000 (09:07 -0600)]
Try harder to define INT64_C and UINT64_C.

These are steadily being used in more and more macros that are
available to extensions as well as core, but the use of Perl's
home-grown versions (for when we don't get them from stdint.h)
has depended on the definition of HAS_QUAD.  However, HAS_QUAD
is explicitly turned off in perl.h when PERL_CORE is not defined,
and has warnings about widespread breakage if that undef were to
be removed (referring to  RT #119753). So extensions that use
macros that in turn use INT64_C or UINT64_C were failing to
build.

So in order to know that 64-bit integers are available without
using the HAS_QUAD macro that was intended for just that purpose,
use QUADKIND as a way of saying "We know we had HAS_QUAD before
you hid it from us."  Ugh.

6 years agoUpdate File-Fetch to CPAN version 0.56
Chris 'BinGOs' Williams [Thu, 30 Nov 2017 16:06:14 +0000 (16:06 +0000)]
Update File-Fetch to CPAN version 0.56

  [DELTA]

0.56        Thu Nov 30 14:47:50 2017

* Blacklist 'lftp' use on hpux

6 years agoRT#132520: mention it's OK to attach a patch to an RT ticket
Marco Fontani [Wed, 29 Nov 2017 17:32:20 +0000 (18:32 +0100)]
RT#132520: mention it's OK to attach a patch to an RT ticket

... as was the case of my first patch to perl: I tried to find my use
case in perlhack.pod, failed, and "hoped for the best".

With this, perlhack makes clearer that attaching a patch to an already
existing RT ticket is a perfectly valid and accepted use-case for
getting patches into perl - same as using perlbug.

6 years agoFix Windows build following commit 184f90dc41
Steve Hay [Thu, 30 Nov 2017 09:05:45 +0000 (09:05 +0000)]
Fix Windows build following commit 184f90dc41

But t/run/switches.t test 131 still fails, with perl.exe crashing.

6 years agoUpgrade experimental from version 0.17 to 0.18
Steve Hay [Thu, 30 Nov 2017 08:37:15 +0000 (08:37 +0000)]
Upgrade experimental from version 0.17 to 0.18

6 years agoUpgrade Test-Simple from version 1.302113 to 1.302120
Steve Hay [Thu, 30 Nov 2017 08:34:52 +0000 (08:34 +0000)]
Upgrade Test-Simple from version 1.302113 to 1.302120

6 years ago(perl #132506) remove an unneeded argument
Tony Cook [Thu, 30 Nov 2017 04:15:26 +0000 (15:15 +1100)]
(perl #132506) remove an unneeded argument

6 years ago(perl #132506) deal with un-/partly implemented *at() functions
Tony Cook [Thu, 30 Nov 2017 14:05:07 +0000 (01:05 +1100)]
(perl #132506) deal with un-/partly implemented *at() functions

NetBSD 6 provides renameat() etc in it's libc, but in the cases where
we use them they fail with ENOSYS.

So I've modified the in-place edit clean up code to attempt to
fallback to the non-at versions of these functions, after checking
that the current directory is sane.

Once I was sure that worked, since the *at() functions don't work for
my use case on NetBSD 6, I've disabled them in hints.

6 years agoPATCH: [perl #132516] locale.c compiler warning
Karl Williamson [Thu, 30 Nov 2017 03:22:45 +0000 (20:22 -0700)]
PATCH: [perl #132516] locale.c compiler warning

This is a problem on Darwin due to a bug there.  MB_CUR_MAX, according
to Tony Cook, is supposed to be an unsigned value according to the C99
standard, and it is in Linux.  But Darwin declares it to be signed, even
though the minimum value it can reach is +1.  Maybe other systems have
the same defect.  But there is a simple fix, just cast it to unsigned.

6 years agomark MB_CUR_MAX constant as unsigned long
Nicolas R [Wed, 29 Nov 2017 21:07:15 +0000 (14:07 -0700)]
mark MB_CUR_MAX constant as unsigned long

Avoid a warning in locale.c

comparison of integers of different signs: 'int' and 'unsigned long'
is_utf8 = MB_CUR_MAX >= STRLENs(MAX_UNICODE_UTF8);

RT #132516

6 years agoperluniprops: Improve sorting
Karl Williamson [Wed, 29 Nov 2017 00:44:02 +0000 (17:44 -0700)]
perluniprops: Improve sorting

Unicode has some property values that should be sorted numerically, but
have prefixes that make them not currently appear to be numbers.  For
example, CCC101 and V10_5.  This commit changes so they are sorted by
their numeric parts.

6 years agoIO test: adjust require for non CORE perl
Nicolas R [Wed, 29 Nov 2017 18:05:17 +0000 (11:05 -0700)]
IO test: adjust require for non CORE perl

fix test t/io_utf8argv.t when run outside of core perl
(noticed this on windows platform)

6 years agoMore UINT64_C.
Jarkko Hietaniemi [Wed, 29 Nov 2017 13:06:16 +0000 (15:06 +0200)]
More UINT64_C.

6 years agoassert() that the vlnz is not NULL before using it.
Jarkko Hietaniemi [Wed, 29 Nov 2017 06:22:29 +0000 (08:22 +0200)]
assert() that the vlnz is not NULL before using it.

Coverity #169272.

6 years agoInitialize variables.
Jarkko Hietaniemi [Wed, 29 Nov 2017 05:50:15 +0000 (07:50 +0200)]
Initialize variables.

Coverity #169257, #169265, #169269.

6 years agoSet safer umask for mkstemp().
Jarkko Hietaniemi [Wed, 29 Nov 2017 05:24:50 +0000 (07:24 +0200)]
Set safer umask for mkstemp().

Coverity #169258.

6 years agoMore robust version of 793c2ded.
Jarkko Hietaniemi [Wed, 29 Nov 2017 05:11:33 +0000 (07:11 +0200)]
More robust version of 793c2ded.

In platforms with st.ino always positive, never even see the negative code.

Coverity #169271.

6 years agosecond arg to mkdir is MODE, not MASK
Marco Fontani [Tue, 28 Nov 2017 12:43:36 +0000 (13:43 +0100)]
second arg to mkdir is MODE, not MASK

RT# 132505

Marco Fontani is now a Perl author.

6 years agoPOSIX.xs: remove unused variable
David Mitchell [Wed, 29 Nov 2017 08:24:21 +0000 (08:24 +0000)]
POSIX.xs: remove unused variable

6 years agorpeep(): use OPpPADHV_ISKEYS, not OPpRV2HV_ISKEYS
David Mitchell [Wed, 29 Nov 2017 08:16:26 +0000 (08:16 +0000)]
rpeep(): use OPpPADHV_ISKEYS, not OPpRV2HV_ISKEYS

I added a bit of code with 748f2c65599 that looked like:

    o->op_private |= (o->op_type == OP_PADHV ?
                      OPpRV2HV_ISKEYS : OPpRV2HV_ISKEYS);

That first constant should of course been OPpPADHV_ISKEYS - although
since both constants currently have the same value, it didn't make any
difference at the time.

Spotted by Coverity, and brought to my attention by jhi++.

6 years agoAssigning non-zero to $[ will become fatal in 5.30
Dagfinn Ilmari Mannsåker [Tue, 21 Nov 2017 21:12:12 +0000 (21:12 +0000)]
Assigning non-zero to $[ will become fatal in 5.30

As agreed at the Perl5 Core Hackathon.

6 years ago$overloaded .= $x: don't stringify $x
David Mitchell [Tue, 28 Nov 2017 09:08:09 +0000 (09:08 +0000)]
$overloaded .= $x: don't stringify $x

RT #132385

This is a variant of the ($ref . $overloaded) bug which was fixed with
v5.27.5-195-gb3ab0375cb.

Basically, when the overloaded concat method is called, it should pass
$x as-is, rather than as "$x". This fixes PDL-2.018

6 years agoperldelta for commit 6f669bf58b
Steve Hay [Tue, 28 Nov 2017 09:10:04 +0000 (09:10 +0000)]
perldelta for commit 6f669bf58b

6 years agoFix $Config{libpth} for x64 builds with VC++ earlier than 14.1 (VS2017)
Steve Hay [Tue, 28 Nov 2017 08:40:56 +0000 (08:40 +0000)]
Fix $Config{libpth} for x64 builds with VC++ earlier than 14.1 (VS2017)

This commit adapts and extends a patch from Marc-Philip
<marc-philip@die-werners.de> on perl #132484.

6 years agoFalse false.
Jarkko Hietaniemi [Tue, 28 Nov 2017 06:15:50 +0000 (08:15 +0200)]
False false.

(Solaris cc got angry.)

6 years agoSTDCHAR * might not be char *.
Jarkko Hietaniemi [Tue, 28 Nov 2017 05:44:10 +0000 (07:44 +0200)]
STDCHAR * might not be char *.

And therefore one may not be able to subtract the pointers,
for example in HP-UX.

6 years agoInitialize the variable.
Jarkko Hietaniemi [Tue, 28 Nov 2017 05:42:54 +0000 (07:42 +0200)]
Initialize the variable.

6 years agoMake certain the info is initialized.
Jarkko Hietaniemi [Tue, 28 Nov 2017 05:28:53 +0000 (07:28 +0200)]
Make certain the info is initialized.

6 years agoIn some systems st.ino is never negative.
Jarkko Hietaniemi [Tue, 28 Nov 2017 05:22:07 +0000 (07:22 +0200)]
In some systems st.ino is never negative.

(Like HP-UX.)

6 years agoUse UINT64_C() for 64-bit constant.
Jarkko Hietaniemi [Tue, 28 Nov 2017 05:19:01 +0000 (07:19 +0200)]
Use UINT64_C() for 64-bit constant.

6 years agoAPItest: Add ability to test API fcn utf8_length()
Karl Williamson [Mon, 27 Nov 2017 21:44:23 +0000 (14:44 -0700)]
APItest: Add ability to test API fcn utf8_length()

6 years agoAPItest: Initialize parameter
Karl Williamson [Mon, 27 Nov 2017 21:43:13 +0000 (14:43 -0700)]
APItest: Initialize parameter

This silences a compiler warning

6 years agoinline.h: White-space only
Karl Williamson [Mon, 27 Nov 2017 00:19:49 +0000 (17:19 -0700)]
inline.h: White-space only

Mostly this indents some code that the previous commit created blocks
around.

6 years agoUse is_utf8_invariant_string() more
Karl Williamson [Mon, 27 Nov 2017 00:06:44 +0000 (17:06 -0700)]
Use is_utf8_invariant_string() more

Now that this function was changed to do word-at-a time searching in
commit e17544a60909ed9555c0dad7cd24afc40eb736e7, we can more quickly
find the first variant byte in a string, if any.  Given that a lot of
usage of Perl is on ASCII data, it makes sense to try this first before
any byte-at-a-time processing.

Since Perl can be used on things that are mostly non-ASCII, we give up
at the first such one, and process the rest of the string byte-by-byte.
Otherwise we could have a pipeline of finding the next variant quickly,
but this would only be faster if variants were rare, which I don't feel
we can be confident about, after finding at least one.

6 years agoFix and clarify the pod for utf8_length()
Karl Williamson [Mon, 27 Nov 2017 05:32:58 +0000 (22:32 -0700)]
Fix and clarify the pod for utf8_length()

Contrary to what it previously said, it does not croak.  This clarifies
what happens if the start and end pointers have the same value.

6 years agotoke.c: Don’t leak memory
Father Chrysostomos [Mon, 27 Nov 2017 00:33:09 +0000 (16:33 -0800)]
toke.c: Don’t leak memory

6 years agoperldelta for 2cb35ee01 / #132485
Father Chrysostomos [Mon, 27 Nov 2017 00:28:51 +0000 (16:28 -0800)]
perldelta for 2cb35ee01 / #132485

6 years agosort perldiag
Father Chrysostomos [Sun, 26 Nov 2017 21:50:30 +0000 (13:50 -0800)]
sort perldiag

6 years ago[perl #132485] Warn about "$foo'bar"
Father Chrysostomos [Sun, 26 Nov 2017 21:41:27 +0000 (13:41 -0800)]
[perl #132485] Warn about "$foo'bar"

6 years agotoke.c: Comment typo
Father Chrysostomos [Sat, 25 Nov 2017 18:07:28 +0000 (10:07 -0800)]
toke.c: Comment typo

6 years agoexpect -k to be overloadable on Win32
Zefram [Sun, 26 Nov 2017 18:20:10 +0000 (18:20 +0000)]
expect -k to be overloadable on Win32

Since commit a6c31837e629c46be2f7496149b36a4b79f93484, the -k filetest
operator works more coherently on Win32, in that it now stats the
requested file and only returns a non-error false result for an extant
file.  This makes it respect string overloading on its argument, which
was previously ignored.  A test of string overloading for filetests
was expecting string overloading to be ignored for -k on Win32, and now
needs to have no such exception.

6 years agoPOSIX.xs: Convert to use is_utf8_non_invariant_string()
Karl Williamson [Sat, 18 Nov 2017 21:21:49 +0000 (14:21 -0700)]
POSIX.xs: Convert to use is_utf8_non_invariant_string()

In localeconv()

6 years agotoke.c: Convert to use is_utf8_non_invariant_string
Karl Williamson [Sat, 18 Nov 2017 21:17:30 +0000 (14:17 -0700)]
toke.c: Convert to use is_utf8_non_invariant_string

6 years agomg.c: Convert to use is_utf8_non_invariant_string()
Karl Williamson [Sat, 18 Nov 2017 21:16:26 +0000 (14:16 -0700)]
mg.c: Convert to use is_utf8_non_invariant_string()

6 years agoAdd is_utf8_non_invariant_string()
Karl Williamson [Sat, 18 Nov 2017 21:05:07 +0000 (14:05 -0700)]
Add is_utf8_non_invariant_string()

This function tells whether or not its argument is a sequence of bytes
that is legal Perl-extended-UTF-8, and which either requires UTF-8
(because it contains wide characters) or would have a different
representation when not under UTF-8.

This paradigm is used in several places in the perl core to decide
whether to turn on an SV's utf8 flag.  None of those places realized
that there was a simple way to avoid rescanning the string (though
perhaps a good C optimizer would).  This commit creates a funtion that
does this task without the rescan; the next commits will convert to use
this function.

6 years agoChange 3 functions to be #defines of others
Karl Williamson [Sat, 18 Nov 2017 20:52:44 +0000 (13:52 -0700)]
Change 3 functions to be #defines of others

I made these separate functions because I thought it would make faster
code, but I realized that modern compilers should be able to optimize
the more general functions into the same code as the ones removed by
this commit, given that the parameters are known to be 0 at compile
time.

It's easier to maintain one version of a function than two, so this
commit favors that.

6 years agoinline.h: Avoid some extra strlen()
Karl Williamson [Sat, 18 Nov 2017 04:59:59 +0000 (21:59 -0700)]
inline.h: Avoid some extra strlen()

The API of these functions says that if the length is 0, strlen() is
called to compute it.  In several cases, control is handed off to a
function using 0, throwing away the already-computed length.  Change
to use the computed length when calling the functions, avoiding the
issue.

6 years agosv_utf8_decode: Reverse order of tests for speed
Karl Williamson [Sat, 25 Nov 2017 04:56:09 +0000 (21:56 -0700)]
sv_utf8_decode: Reverse order of tests for speed

Not that we have a fast is_utf8_invariant_string_loc(), use it first to
quickly find any variants.  Then use is_utf8_string() from then on.
This is the reverse order as to how it worked before this commit.  This
speeds things up two ways: 1) we use the faster function first, and 2)
use the information it returns to avoid reparsing the string starting at
the beginning.

6 years agopp_sys.c: Avoid reparsing string
Karl Williamson [Sat, 18 Nov 2017 23:36:45 +0000 (16:36 -0700)]
pp_sys.c: Avoid reparsing string

By using is_utf8_invariant_string_loc() instead of plain
is_utf8_invariant_string(), we can start parsing at the first variant
(if any is found) instead of the previous behavior of starting again at
the beginning of the string.

6 years agominiperl/minitest cannot do these tests.
Jarkko Hietaniemi [Fri, 24 Nov 2017 06:00:20 +0000 (08:00 +0200)]
miniperl/minitest cannot do these tests.

6 years agotoke.c lex_stuff_pvn(): Use fcn, not handrolled code
Karl Williamson [Thu, 23 Nov 2017 06:13:29 +0000 (23:13 -0700)]
toke.c lex_stuff_pvn(): Use fcn, not handrolled code

Use the inline function that accomplishes the same thing as this
hand-rolled code.  The inline function should generate the same thing on
ASCII platforms, but be faster on EBCDIC ones.

6 years agomktables: Avoid some work
Karl Williamson [Tue, 21 Nov 2017 18:44:11 +0000 (11:44 -0700)]
mktables: Avoid some work

Some tables generated by this program are completely described as the
complements of other tables.  There is no need to thus generate them, as
when their value is needed, they can be generated from the other one.
However, this takes time, and so this commit caches the result the first
time it is needed, and returns that for any future needs.

This must not be done until after the controlling table is fully
populated, or else the cache would have to be invalidated.  Since there
is unlikely to be the need for getting the value before the populating
is one, What is done here is to simply lock the controlling table, so
that any attempt to change it will raise an error, and the code can be
fixed at that time, if the need ever does arise.

6 years agodoop.c: Change to use is_utf8_invariant_string()
Karl Williamson [Wed, 22 Nov 2017 22:39:13 +0000 (15:39 -0700)]
doop.c: Change to use is_utf8_invariant_string()

This commit changes 3 occurrences of byte-at-a-time looking to see if a
string is invariant under UTF-8, to using the inlined
is_utf8_invariant_string() which now does much faster word-at-a-time
looking.

6 years agoSearch for UTF-8 invariants by word
Karl Williamson [Wed, 15 Nov 2017 17:19:33 +0000 (10:19 -0700)]
Search for UTF-8 invariants by word

The functions is_utf8_invariant_string() and
is_utf8_invariant_string_loc() are used in several places in the core
and are part of the public API.  This commit speeds them up
significantly on ASCII (not EBCDIC) platforms, by changing to use
word-at-a-time parsing instead of per-byte.  (Per-byte is retained for
any initial bytes to reach the next word boundary, and any final bytes
that don't fill an entire word.)

The following results were obtained parsing a long string on a 64-bit
word machine:

        byte   word
       ------ ------
    Ir 100.00 665.35
    Dr 100.00 797.03
    Dw 100.00 102.12
  COND 100.00 799.27
   IND 100.00  97.56

COND_m 100.00 144.83
 IND_m 100.00  75.00

 Ir_m1 100.00 100.00
 Dr_m1 100.00 100.02
 Dw_m1 100.00 104.12

 Ir_mm 100.00 100.00
 Dr_mm 100.00 100.00
 Dw_mm 100.00 100.00

100% is baseline; numbers larger than that are improvements.  The COND
measurement indicates, for example, that there 1/8 as many conditional
branches in the word-at-a-time version.

6 years agoutf8.c: White-space only
Karl Williamson [Thu, 23 Nov 2017 06:18:04 +0000 (23:18 -0700)]
utf8.c: White-space only

Properly outdent 2 lines

6 years ago[MERGE] t/TEST -deparse fixups
David Mitchell [Thu, 23 Nov 2017 10:45:59 +0000 (10:45 +0000)]
[MERGE] t/TEST -deparse fixups

One of my occasional attempts to fix regressions in 'TEST -deparse' -
which runs every test script through the deparser, then tries to execute
it.

This branch fixes the following regressing scripts:

    opbasic/concat.t
    op/hash.t
    op/sort.t
    op/state.t
    ../cpan/Test-Harness/t/compat/test-harness-compat.t
    ../dist/autouse/t/autouse.t
    ../ext/XS-Typemap/t/Typemap.t

and updates Porting/deparse-skips.txt to note the following
expected-to-fail scripts are now passing:

    ../cpan/Socket/t/sockaddr.t
    ../dist/IO/t/io_sel.t
    ../dist/PathTools/t/cwd.t
    ../dist/Storable/t/blessed.t
    ../ext/B/t/xref.t
    ../lib/Benchmark.t

and marks the following as a new expected-fail (due to hard-coded line
numbers in tests):

    ../cpan/Test-Simple/t/Legacy/no_plan.t

6 years agoupdate Porting/deparse-skips.txt
David Mitchell [Wed, 22 Nov 2017 23:13:47 +0000 (23:13 +0000)]
update Porting/deparse-skips.txt

Since the last update (Jun 2017), one test script has stopped passing
under 't/TEST -deparse':

    ../cpan/Test-Simple/t/Legacy/no_plan.t

due to hard-code expected line numbers in tests for warning messages;
while the following test scripts have started passing:

    ../cpan/Socket/t/sockaddr.t
    ../dist/IO/t/io_sel.t
    ../dist/PathTools/t/cwd.t
    ../dist/Storable/t/blessed.t
    ../ext/B/t/xref.t
    ../lib/Benchmark.t

6 years agoautouse: fix autouse.t deparsing
David Mitchell [Wed, 22 Nov 2017 17:38:42 +0000 (17:38 +0000)]
autouse: fix autouse.t deparsing

autouse.t uses B as a random test XS module which it can defer loading.
However, B recently changed to not use Exporter, which upsets autouse:
but *only* when running under 't/TEST -deparse'. I'm not sure why it only
fails then, but in any case, this commit changes it so that it uses
Hash::Util instead.

6 years agoDeparse: handle warnings NOFATAL
David Mitchell [Wed, 22 Nov 2017 17:01:04 +0000 (17:01 +0000)]
Deparse: handle warnings NOFATAL

In general, Deparse currently outputs 'use warnings foo' as

BEGIN {${^WARNING_BITS} =
    "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}

or similar, except that it special-cases all bits being set or unset as

    use warnings;
and
    no warnings;

This failed for something like

    use warnings FATAL => all;
    {
        use warnings NOFATAL => all;
    }

since was deparing the NOFATAL line as a simple

    use warnings;

which is wrong.

So don't just see whehter the final bit pattern matches 'use/no warnings';
also see whether there are any other bits which need turning off.

6 years agoDeparse: handle state attributes
David Mitchell [Wed, 22 Nov 2017 16:03:29 +0000 (16:03 +0000)]
Deparse: handle state attributes

It already correctly deparses e.g.

    my $x :shared = 1;

Now that attributes are legal on state vars, extend deparsing to them too:

    state $x :shared = 1;

Also, rename maybe_my_attr() to maybe_var_attr() to reflect its widened
role.

6 years agoDeparse: don't parenthesise state @a = ...
David Mitchell [Wed, 22 Nov 2017 13:32:03 +0000 (13:32 +0000)]
Deparse: don't parenthesise state @a = ...

It was deparsing

    state @a = ...

as

    (state(@a)) = ...

(and similarly for CORE::state(...))

However, a list assign of a state array/hash is currently only legal
in the absence of parens.

6 years agoTEST -deparse: don't list unexpected pass as fail
David Mitchell [Wed, 22 Nov 2017 12:25:28 +0000 (12:25 +0000)]
TEST -deparse: don't list unexpected pass as fail

When running a test script under TEST -deparse, if it passes, but
according to Porting/deparse-skips.txt it was expected to fail, then
don't list it as a failing test. It wil still get listed at the end
in the section on unexpected passes, so there's no need to list it twice.

6 years agoDon't Deparse "${$}abc" as "$$abc"
David Mitchell [Wed, 22 Nov 2017 12:14:42 +0000 (12:14 +0000)]
Don't Deparse "${$}abc" as "$$abc"

This fixes ./TEST -deparse op/stat.t

This only fixes multiconcat - in theory concat suffers from the same bug,
although in practice any concat expression involving at least one constant
string will be upgraded to multiconcat.

6 years agoDeparse: avoid upgrading RV to GV in stash entries
David Mitchell [Wed, 22 Nov 2017 09:51:24 +0000 (09:51 +0000)]
Deparse: avoid upgrading RV to GV in stash entries

As well as being undesirable in its own right, it was causing some subs
not to be deparsed.

In something like

    package Foo;
    sub f { ... }
    *g = \&f;

The stash entry $Foo::{f} is an RV pointing to the CV, while $Foo::{g} is
a GV whose CV slot points to the same CV.

That CV's CvNAME() will be 'f' and its CvSTASH() will point to %Foo::.

If Deparse attempts to process $Foo::{g} before $Foo::{f}, it will get a
GV and in that code path it does something like

    $cv = $gv->CV;
    next if $$gv != ${$cv->GV}; # Ignore imposters

The trouble is that $cv->GV calls (at the C level) CvGV(cv), which tries
to retrieve the GV stored in $Foo::{f}, and finding only an RV, upgrades
it to a GV.

This confuses Deparse, because it has already created objects for all the
stash's entries, so when it comes to process $Foo::{f}, it already
has a B::IV object for the RV (and so goes down the RV code path), but
further introspection of that object (such as flags) sees a GV,

Hence the 3 lines of code at the top of this text were being deparsed
without 'sub f {}' being emitted.

This has been a problem for a while, but only recently has the "RV->CV
instead of GV->CV" optimisation been applied outside of package main::,
and so become more noticeable.

6 years agoDeparse nested (($x .= ...) .= ...) correctly.
David Mitchell [Fri, 17 Nov 2017 12:47:07 +0000 (12:47 +0000)]
Deparse nested (($x .= ...) .= ...) correctly.

It was sometimes outputting '.=' as '.'.

Now that the OPpCONCAT_NESTED flag has been added to indicate
that OPf_STACKED has been set on a concat op as an optimisation rather than
indictating .=, it's easier to deparse CONCAT/OPf_STACKED correctly.

6 years agoadd OPpCONCAT_NESTED flag
David Mitchell [Fri, 17 Nov 2017 12:23:17 +0000 (12:23 +0000)]
add OPpCONCAT_NESTED flag

This flag makes no functional difference to runtime (it merely flags
that an optimisation has been performed), but it will shortly be used to
assist Deparse and warnings.

OPf_STACKED, when set on a OP_CONCAT, normally indicates .=; but it
also gets set to optimise

    $a . $b . $c

into

    ($a . $b) .= $c

so that the first concat's PADTMP (which holds the result of $a.$b) can be
reused. Set a flag in this case to help deparse and warn distinguish the
cases.

6 years agoDeparse.pm: handle optimised-away keys() better
David Mitchell [Fri, 17 Nov 2017 11:16:08 +0000 (11:16 +0000)]
Deparse.pm: handle optimised-away keys() better

keys() in void/scalar context optimises away the OP_KEYS op and handles
the action directly in the OP_PADHV or OP_RV2HV op.  However, Deparse
wasn't handling precedence correctly, so for example

    keys(%h) / 2

was being deparsed as

    keys %h/2

Also, keys wasn't being output as CORE::keys in the presence of

    sub keys {}

6 years agoUpgrade Compress-Raw-Zlib from version 2.075 to 2.076
Steve Hay [Thu, 23 Nov 2017 08:22:21 +0000 (08:22 +0000)]
Upgrade Compress-Raw-Zlib from version 2.075 to 2.076

6 years agoUpgrade Unicode-Collate from version 1.24 to 1.25
Steve Hay [Thu, 23 Nov 2017 08:20:09 +0000 (08:20 +0000)]
Upgrade Unicode-Collate from version 1.24 to 1.25

6 years agobisect-runner: Add --test-module option
Father Chrysostomos [Thu, 23 Nov 2017 02:41:52 +0000 (18:41 -0800)]
bisect-runner: Add --test-module option

See the POD documentation in the diff for details.

6 years agoSync ExtUtils-CBuilder with CPAN release 0.280230
Alberto Simões [Wed, 22 Nov 2017 16:21:21 +0000 (16:21 +0000)]
Sync ExtUtils-CBuilder with CPAN release 0.280230

    0.280230 - 2017-11-22

      Fixed:

      - Updated Changes
      - Used OurPkgVersion instead of PkgVersion

6 years agoFix test failures in GCC "long doubles" builds on Windows
Steve Hay [Wed, 22 Nov 2017 08:22:55 +0000 (08:22 +0000)]
Fix test failures in GCC "long doubles" builds on Windows

Patch by sisyphus1@optusnet.com.au on perl #132479.

6 years agoBump Carp to version 1.45
Nicolas R [Tue, 21 Nov 2017 22:58:14 +0000 (15:58 -0700)]
Bump Carp to version 1.45

Previous Carp update from 915a6810d3 was merged
after 5.27.6 release... so we need to bump
the release version.

6 years agofix wordwrapping on generated acknowledgements text
Karen Etheridge [Tue, 21 Nov 2017 22:43:04 +0000 (14:43 -0800)]
fix wordwrapping on generated acknowledgements text

experimentation reveals that 77 chars is just sufficient to produce
output such that gmail will not re-wrap the text and make release
announcements dreadfully ugly.

6 years agoadd link to announcement email
Karen Etheridge [Tue, 21 Nov 2017 22:42:48 +0000 (14:42 -0800)]
add link to announcement email

6 years agoCarp: optimize format_arg when arguments contain many references
J. Nick Koston [Thu, 12 Oct 2017 06:57:36 +0000 (01:57 -0500)]
Carp: optimize format_arg when arguments contain many references

RT #132274

This is a very minimal patch after RT discussion.
When using the CPAN version of UNIVERSAL::isa we cannot
use UNIVERSAL::isa on Carp without taking the risk of
going into one infinite loop.

As UNIVERSAL::isa on CPAN is the only one to advertise
a VERSION, we can use this value to disable the UNIVERSAL
check.

Note version bump is not required as it already occurred
since v5.27.5 release.

Signed-off-by: Nicolas R <atoomic@cpan.org>
6 years agoFix release schedule
Sawyer X [Tue, 21 Nov 2017 14:12:04 +0000 (15:12 +0100)]
Fix release schedule

6 years agoBump Locale-Codes from 3.54 to 3.55
Sullivan Beck [Fri, 17 Nov 2017 15:59:43 +0000 (10:59 -0500)]
Bump Locale-Codes from 3.54 to 3.55

Includes perldelta entry noting its deprecation in core.

6 years agoupdate newGIVENOP() doc for loss of lexical $_
Zefram [Tue, 21 Nov 2017 09:32:09 +0000 (09:32 +0000)]
update newGIVENOP() doc for loss of lexical $_

6 years agoUpdate META.json for JSON::PP update
Steve Hay [Tue, 21 Nov 2017 08:46:18 +0000 (08:46 +0000)]
Update META.json for JSON::PP update

6 years agoModule::CoreList 5.20171120 is now on CPAN
Steve Hay [Tue, 21 Nov 2017 08:29:53 +0000 (08:29 +0000)]
Module::CoreList 5.20171120 is now on CPAN

6 years agoUpgrade JSON::PP from version 2.94 to 2.97000
Steve Hay [Tue, 21 Nov 2017 08:29:00 +0000 (08:29 +0000)]
Upgrade JSON::PP from version 2.94 to 2.97000