This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
2 years agoregcomp.c: Can join certain EXACTish node types
Karl Williamson [Mon, 3 Dec 2018 18:33:49 +0000 (11:33 -0700)]
regcomp.c: Can join certain EXACTish node types

The optimization phase of regular expression pattern compilation looks
for adjacent EXACTish nodes and joins them if they are the same flavor
of EXACT.  Commits a9f8c7ac75c364c3e05305718f38c5f8ccd935d8 and
f6b4b99d2e584fbcd85eeed475eea10b87858e54 introduced two new nodes
that are so close to existing flavors that they are joinable with their
respective flavor.  This commit does that.

2 years agoregcomp.c: Move clause of while() conditional into loop
Karl Williamson [Mon, 3 Dec 2018 00:45:06 +0000 (17:45 -0700)]
regcomp.c: Move clause of while() conditional into loop

This is in preparation for making the conditional more complicated than
can be easily done in the condition.

2 years agoregcomp.c: Add assertion
Karl Williamson [Sun, 2 Dec 2018 19:27:46 +0000 (12:27 -0700)]
regcomp.c: Add assertion

2 years agoRemove one use of static function
Karl Williamson [Sun, 2 Dec 2018 19:38:27 +0000 (12:38 -0700)]
Remove one use of static function

Previous commits in 5.29 have removed all but two calls to this
function, and the remaining ones take radically different paths in it,
with very little common code.  It simplifies things if we expand each
call to the code that gets evaluated.  This commit does one call.
Changing the other usage is deferred until a later commit.

The need for an #ifdef is removed by adding a flag and setting it in an
existing #ifdef.

2 years agoNo need to convert int to long to int
H.Merijn Brand [Fri, 7 Dec 2018 13:43:37 +0000 (14:43 +0100)]
No need to convert int to long to int

Beyond that, I agree with this branch

Signed-off-by: James E Keenan <jkeenan@cpan.org>
2 years agoNo need to include 'values.h'.
James E Keenan [Wed, 28 Nov 2018 03:15:22 +0000 (22:15 -0500)]
No need to include 'values.h'.

timecheck.c does not appear to use any thing from this file.  Linux
documentation marks the interface as obsolete.  It's not found, e.g., on
FreeBSD.

2 years agoEliminate 4 build-time warnings in timecheck.c.
James E Keenan [Tue, 27 Nov 2018 21:12:45 +0000 (16:12 -0500)]
Eliminate 4 build-time warnings in timecheck.c.

This commit suppresses output like this:

[Porting] 758 $ cc -O -o timecheck timecheck.c
timecheck.c: In function ‘gm_check’:
timecheck.c:37:36: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
      fprintf (stderr, "%3d:%s: %12ld-%02d-%02d %02d:%02d:%02d\n",
                                ~~~~^
                                %12d
timecheck.c:39:3:
   tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
   ~~~~~~~~~~~~~~~~~~~
timecheck.c: In function ‘lt_check’:
timecheck.c:89:36: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
      fprintf (stderr, "%3d:%s: %12ld-%02d-%02d %02d:%02d:%02d\n",
                                ~~~~^
                                %12d
timecheck.c:91:3:
   tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
   ~~~~~~~~~~~~~~~~~~~
timecheck.c: In function ‘main’:
timecheck.c:130:21: warning: implicit declaration of function ‘strcmp’ [-Wimplicit-function-declaration]
     if (argc > 1 && strcmp (argv[1], "-v") == 0) opt_v++;
                     ^~~~~~
timecheck.c:139:32: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int’ [-Wformat=]
     printf ("Sizeof time_t = %ld\n", (i = sizeof (time_t)));
                              ~~^     ~~~~~~~~~~~~~~~~~~~~~
                              %d

2 years agoUse more plausible argument for 'cd' in example.
James E Keenan [Tue, 27 Nov 2018 21:07:35 +0000 (16:07 -0500)]
Use more plausible argument for 'cd' in example.

In our documentation we generally assume that the user is navigating
from the top-level of the core distribution.  If so, then to compile a C
program found in Porting/ the user would simply 'cd Porting' rather than
'cd perl/Porting'.

2 years agoregen/mk_invlists.pl: Add new table
Karl Williamson [Thu, 6 Dec 2018 23:57:17 +0000 (16:57 -0700)]
regen/mk_invlists.pl: Add new table

This table contains all the code points that are in any multi-character
fold (not the folded-from character, but what that character folds to).

It will be used in a future commit.

2 years agoregen/mk_invlists.pl: Rmv no longer used array
Karl Williamson [Thu, 6 Dec 2018 23:53:23 +0000 (16:53 -0700)]
regen/mk_invlists.pl: Rmv no longer used array

2 years agot/harness: Catch incorrect serial directory specification
Karl Williamson [Fri, 7 Dec 2018 17:42:21 +0000 (10:42 -0700)]
t/harness: Catch incorrect serial directory specification

The previous commit fixed a bug.  This commit detects if someone creates
a new instance of that bug.

2 years agot/harness: Actually run IO::Zlib tests sequentially
Karl Williamson [Fri, 7 Dec 2018 17:32:35 +0000 (10:32 -0700)]
t/harness: Actually run IO::Zlib tests sequentially

Commit bc55cddf915d70f806feda38506788f4c61a2574 tried to do this, but it
turns out it didn't actually, because it didn't precisely name the
directory.

2 years agoMake ext/B/t/strict.t test alike to other ones.
Petr Písař [Fri, 7 Dec 2018 14:25:53 +0000 (09:25 -0500)]
Make ext/B/t/strict.t test alike to other ones.

Signed-off-by: Petr Písař <ppisar@redhat.com>
For: RT 133713

2 years agoCorrect error message in t/taint.t.
James E Keenan [Fri, 7 Dec 2018 02:42:51 +0000 (02:42 +0000)]
Correct error message in t/taint.t.

In this test file, our temporary directory is named 'for_find_taint'.
Make sure the error method reflects that.  (This was overlooked in
f09dd912ca4 2018-11-19.)

2 years agoregcomp.c: Use simpler variable name as long as possible
Karl Williamson [Sun, 2 Dec 2018 20:05:47 +0000 (13:05 -0700)]
regcomp.c: Use simpler variable name as long as possible

This just extends the use of a variable name a little longer, as it's
easier to read than the nested macro calls that eventually have to be
used.

2 years agoregcomp.c: Prefer one of similarly named vars
Karl Williamson [Sun, 2 Dec 2018 19:22:39 +0000 (12:22 -0700)]
regcomp.c: Prefer one of similarly named vars

These two variables are similarly named, but have slightly different
purposes.  Comment out one of them, and convert to using the other
consistently

2 years agot/re/anyof.t: Remove duplicate test case
Karl Williamson [Sun, 2 Dec 2018 18:46:07 +0000 (11:46 -0700)]
t/re/anyof.t: Remove duplicate test case

2 years agoUse consistent spelling in qr// dumping
Karl Williamson [Sun, 2 Dec 2018 18:17:26 +0000 (11:17 -0700)]
Use consistent spelling in qr// dumping

Under -Dr (or use re 'Debug') the compiled regex engine program is
displayed.  I noticed that it used two different spellings for
'infinity'.  This commit changes so only one is used, the one that has
been in the field the longest.

2 years agoregcomp.c: Clarify comment
Karl Williamson [Wed, 5 Dec 2018 01:22:05 +0000 (18:22 -0700)]
regcomp.c: Clarify comment

2 years agoFix t/porting/manifest.t failures when run in a foreign git checkout
Niko Tyni [Sun, 2 Dec 2018 09:57:01 +0000 (11:57 +0200)]
Fix t/porting/manifest.t failures when run in a foreign git checkout

The change at ba6733216202523a95b0b7ee2e534b8e30b6d7df didn't work
correctly: find_git_or_skip() in t/test.pl looks at PERL_BUILD_PACKAGING
too late, so it doesn't change the logic of skipping, only the explanation
of why tests get skipped if they do. This was originally reported at
<https://bugs.debian.org/914962>.

Committer: update commit message for upstream context

2 years agoregcomp.sym: Clarify descriptions of EXACTish regnodes
Karl Williamson [Wed, 5 Dec 2018 00:59:31 +0000 (17:59 -0700)]
regcomp.sym: Clarify descriptions of EXACTish regnodes

2 years agoinline.h: Clarify comment
Karl Williamson [Tue, 4 Dec 2018 19:05:59 +0000 (12:05 -0700)]
inline.h: Clarify comment

This function works as well as possible on non-UTF-8 inputs.  No need to
list the UTF-8-only failures, since those aren't legal inputs.

2 years agobump $ExtUtils::ExtUtils::VERSION to 3.40
Tony Cook [Wed, 5 Dec 2018 04:35:19 +0000 (15:35 +1100)]
bump $ExtUtils::ExtUtils::VERSION to 3.40

2 years ago(perl #133654) don't include OUTLIST parameters in the prototype
Tony Cook [Wed, 5 Dec 2018 04:22:52 +0000 (15:22 +1100)]
(perl #133654) don't include OUTLIST parameters in the prototype

The generated prototype (with PROTOTYPES: ENABLE) would include
OUTLIST parameters, but these aren't arguments to the perl function.

2 years ago(perl #133706) remove exploit code from Storable
Tony Cook [Mon, 3 Dec 2018 05:15:52 +0000 (16:15 +1100)]
(perl #133706) remove exploit code from Storable

Storable packaged the metasploit framework code for CVE-2015-1592,
which triggered virus scanners.

To prevent that remove the packaged exploit code and test for the
underlying structure we trigger the warning on.

2 years agoAdd header-guards to 2 additional files
James E Keenan [Tue, 4 Dec 2018 00:25:51 +0000 (19:25 -0500)]
Add header-guards to 2 additional files

Two header files in ext/SDBM_File appear to be blead-upstream, so we can
add header guards here as well.

For: RT 133699

2 years agoProvide header guards to prevent re-inclusion
James E Keenan [Thu, 29 Nov 2018 03:50:29 +0000 (22:50 -0500)]
Provide header guards to prevent re-inclusion

Per LGTM analysis: https://lgtm.com/projects/g/Perl/perl5/alerts/?mode=tree&ruleFocus=2163210746

and LGTM recommendation: https://lgtm.com/rules/2163210746/

For: RT 133699

2 years agoRevert "regcomp.c: Use a weird value in a place where ignored"
Karl Williamson [Sun, 2 Dec 2018 08:30:39 +0000 (01:30 -0700)]
Revert "regcomp.c: Use a weird value in a place where ignored"

This reverts commit 5a4bc50b395654abde21718cbce2e296049f470d.
It turns out I was wrong, and the value isn't ignored.  The commit
caused the pattern to be optimized differently, but still be valid,
so no tests failed.

2 years agoSync Test::Simple with CPAN version 1.302141
James E Keenan [Sat, 1 Dec 2018 17:58:41 +0000 (12:58 -0500)]
Sync Test::Simple with CPAN version 1.302141

Committer:  Update perldelta

2 years agoAdd instruction to configure to SYNOPSIS
James E Keenan [Sat, 1 Dec 2018 17:39:27 +0000 (12:39 -0500)]
Add instruction to configure to SYNOPSIS

Because I always to forget to ./Configure before trying to bring in an
updated upstream module from CPAN.

2 years agoCorrect typo
James E Keenan [Fri, 30 Nov 2018 03:12:10 +0000 (22:12 -0500)]
Correct typo

2 years agoDrop sentence which is no longer valid as of 5.28
James E Keenan [Fri, 30 Nov 2018 03:09:41 +0000 (22:09 -0500)]
Drop sentence which is no longer valid as of 5.28

Per recommendation of Dan Book.

For: RT 133705

2 years agoTick off 5.26.3 and 5.28.1
Steve Hay [Thu, 29 Nov 2018 21:06:04 +0000 (21:06 +0000)]
Tick off 5.26.3 and 5.28.1

2 years agoperlhist for 5.26.3 and 5.28.1
Steve Hay [Thu, 29 Nov 2018 21:03:00 +0000 (21:03 +0000)]
perlhist for 5.26.3 and 5.28.1

These were applied to maint-5.26 and maint-5.28 in the following commits:

maint-5.26:
b9de8c10f90b3a2559572b35083d7004790ff6aa
1c6b38711fd6e33e1305d39081a7ed6977e2dadb

maint-5.28:
d7dd16fb7dd9064a236e9430754052ab496e3b4c
63afdf6c0f65af480aa5bb9ccba9f46dae52f6fc

2 years agoImport perl5263delta.pod and perl5281delta.pod
Steve Hay [Thu, 29 Nov 2018 20:49:00 +0000 (20:49 +0000)]
Import perl5263delta.pod and perl5281delta.pod

2 years agoUpdate Module-CoreList with data for 5.26.3 and 5.28.1
Steve Hay [Thu, 29 Nov 2018 20:11:17 +0000 (20:11 +0000)]
Update Module-CoreList with data for 5.26.3 and 5.28.1

2 years agoEpigraphs for 5.26.3 and 5.28.1
Steve Hay [Thu, 29 Nov 2018 19:49:30 +0000 (19:49 +0000)]
Epigraphs for 5.26.3 and 5.28.1

2 years agoPATCH: [perl #133423]
Karl Williamson [Mon, 24 Sep 2018 17:16:14 +0000 (11:16 -0600)]
PATCH: [perl #133423]

2 years agolocale.c: Failure to build if not allowing LC_COLLATE
Karl Williamson [Thu, 29 Nov 2018 18:55:09 +0000 (11:55 -0700)]
locale.c: Failure to build if not allowing LC_COLLATE

This is part of [perl #133696].  A typo was causing a macro to be
defined in terms of itself, hence an illegal recursive definition.

2 years agolocale.c: Don't use numeric unless LC_NUMERIC
Karl Williamson [Thu, 29 Nov 2018 18:53:58 +0000 (11:53 -0700)]
locale.c: Don't use numeric unless LC_NUMERIC

This commit #ifdef's a usage of a variable that isn't valid unless the
system has LC_NUMERIC

2 years agolocale.c: Fix wrong scope of #if's
Karl Williamson [Thu, 29 Nov 2018 18:50:58 +0000 (11:50 -0700)]
locale.c: Fix wrong scope of #if's

The function print_bytes_for_locale() should be defined if DEBUGGING;
prior to this commit it didn't get defined unless LC_COLLATE was
defined on the platform.

2 years agoMore removals of $a,$b in perldata for [#perl #133700]
Eugen Konkov [Thu, 29 Nov 2018 17:56:07 +0000 (10:56 -0700)]
More removals of $a,$b in perldata for [#perl #133700]

2 years agoPATCH: [perl #133700] avoid use of $a and $b in perldata
Eugen Konkov [Thu, 29 Nov 2018 17:21:20 +0000 (10:21 -0700)]
PATCH: [perl #133700] avoid use of $a and $b in perldata

2 years agomake boot_Win32CORE extern "C" for C++ builds origin/tonyc/cygwin-fixes
Tony Cook [Thu, 29 Nov 2018 03:16:03 +0000 (14:16 +1100)]
make boot_Win32CORE extern "C" for C++ builds

2 years agostdio.h on Cygwin doesn't expose cuserid() with _GNU_SOURCE
Tony Cook [Thu, 29 Nov 2018 03:12:01 +0000 (14:12 +1100)]
stdio.h on Cygwin doesn't expose cuserid() with _GNU_SOURCE

It's probably possible to expose it by setting _XOPEN_SOURCE to
some specific value, but this appears to be a bug.

https://cygwin.com/ml/cygwin/2018-11/msg00230.html

2 years agoPass a UV to a format expecting a UV
Tony Cook [Wed, 28 Nov 2018 23:50:19 +0000 (23:50 +0000)]
Pass a UV to a format expecting a UV

MAX_LEGAL_CP can end up as int depending on the ranges of the types
involved, causing a type mismatch on the format in cp_above_legal_max.

By adding the cast to the macro definition we both prevent the type
mismatch on the format, but also may allow some static analysis tool to
detect comparisons against signed types, which is likely an error.

2 years agoUpgrade to threads::shared 1.59
jdhedden [Wed, 28 Nov 2018 03:53:40 +0000 (22:53 -0500)]
Upgrade to threads::shared 1.59

Committer: perldelta entry

2 years agoAdd USE_THREAD_SAFE_LOCALE to non-bin-compat options list
Karl Williamson [Tue, 27 Nov 2018 17:07:12 +0000 (10:07 -0700)]
Add USE_THREAD_SAFE_LOCALE to non-bin-compat options list

Spotted by Tux

2 years agoregcomp.c: White-space only
Karl Williamson [Tue, 27 Nov 2018 16:43:01 +0000 (09:43 -0700)]
regcomp.c: White-space only

Vertical align continuation chars in a macro

2 years agoAdd regnode EXACTFU_ONLY8
Karl Williamson [Tue, 27 Nov 2018 16:42:45 +0000 (09:42 -0700)]
Add regnode EXACTFU_ONLY8

This is a regnode that otherwise would be an EXACTFU except that it
contains a code point that requires UTF-8 to match, including all the
possible folds involving it.  Hence if the target string isn't UTF-8, we
know it can't possibly match, without needing to try.

For completeness, there could also be an EXACTFAA_ONLY8 and an
EXACTFL_ONLY8 created, but I think these are unlikely to actually appear
in the wild, since using /aa is mainly about ASCII, and /l mostly will
involve characters that don't require UTF-8.

2 years agoAdd regnode EXACT_ONLY8
Karl Williamson [Sat, 17 Nov 2018 22:51:19 +0000 (15:51 -0700)]
Add regnode EXACT_ONLY8

This is a regnode that otherwise would be an EXACT except that it
contains a code point that requires UTF-8 to represent.  Hence if the
target string isn't UTF-8, we know it can't possibly match, without
needing to try.

2 years agoregcomp.c: Use common code instead of duplicating it
Karl Williamson [Sat, 17 Nov 2018 22:47:02 +0000 (15:47 -0700)]
regcomp.c: Use common code instead of duplicating it

The common code is about to get more complicated, so use it instead of a
copy.

2 years agoperlreref.pod: disambiguate "code"
David Mitchell [Tue, 27 Nov 2018 16:36:35 +0000 (16:36 +0000)]
perlreref.pod: disambiguate "code"

It says:

   (?(cond)yes)      Conditional expression, where "cond" can be:
                     (?=pat)   lookahead
                     ...

A strict reading of that is that there must be two pairs of parens
in each conditional construct, e.g. (?((?=pat))yes).

Make the text clearer.

2 years agohandle /(?(?{code}))/ mixed compile-and runtime
David Mitchell [Tue, 27 Nov 2018 13:26:39 +0000 (13:26 +0000)]
handle /(?(?{code}))/ mixed compile-and runtime

Where a runtime pattern contains both compile-time and run-time code
blocks, e.g.:

    $re = '(?{ RRR })';
    / $re X(?{ CCC })Y/

The compile-time code-block CCC is parsed at the same time as the
surrounding text. The runtime code RRR is parsed at runtime by
constructing a fake pattern and re-parsing it, but with any compile-time
code-blocks blanked out (so they don't get compiled twice). The compiled
regex is then thrown away, but any optrees just created for the runtime
code blocks are kept.

For example at runtime, the re-parsed pattern looks like:

    / (?{ RRR }) X__________Y/

Unfortunately this was failing for the conditional pattern, e.g.

    / $re X(?(?{ CCC }))Y/

which was getting blanked as

    / (?{ RRR }) X(?_______)Y/

which isn't valid syntax.

This commit blanks (?{...}) into (?=====) instead which is always legal.

2 years agoRely on C89 "const"
Aaron Crane [Tue, 27 Nov 2018 11:32:11 +0000 (11:32 +0000)]
Rely on C89 "const"

The metaconfig probe for <db.h> previously relied on the d_const symbol set
by the "const" probe, so generating Configure here has been done against
metaconfig commit 1204d4627a06b11f16620188f3fa83159ed35fd9 which changes
that.

Thanks to khw++ for pointing out this oversight in my attempt last year to
make the codebase rely on C89.

2 years agoregexec.c: Use ANYOF bitmap lookup in more cases
Karl Williamson [Sun, 18 Nov 2018 22:46:07 +0000 (15:46 -0700)]
regexec.c: Use ANYOF bitmap lookup in more cases

ANYOFish nodes have a bitmap.  If we know the value is in the bitmap
range, then flags that apply to out-of-range values are irrelevant.
Other flags being set indicate that the desired answer is more
complicated than just using a bitmap lookup.  But exclude this
irrelevant flag from that calculation when we know the value is in the
bitmap.

There are other flags that it is possible to exclude, but not without
further conditionals, or unsharing code, and are either rarely set or
are for node types that we don't worry so much about optimal
performance, like /l and /d.  The changes introduced by this commit
are determined at .c compile time except for a runtime mask, and hence
don't introduce new branches that may destroy the instruction cache
pipeline.

2 years agoregexec.c: Refactor expanded macro from prev. commit
Karl Williamson [Sun, 18 Nov 2018 22:24:45 +0000 (15:24 -0700)]
regexec.c: Refactor expanded macro from prev. commit

2 years agoregexec.c: Expand out macro in only remaining use
Karl Williamson [Sun, 18 Nov 2018 22:12:02 +0000 (15:12 -0700)]
regexec.c: Expand out macro in only remaining use

There is only one call to this macro.  It's easier to understand if
expanded out instead of the call.  The next commit will refactor.

2 years agoregcomp.c: Clarify comment
Karl Williamson [Wed, 21 Nov 2018 03:59:18 +0000 (20:59 -0700)]
regcomp.c: Clarify comment

2 years agoregcomp.c: Initialize a variable more conservatively
Karl Williamson [Sun, 18 Nov 2018 21:52:15 +0000 (14:52 -0700)]
regcomp.c: Initialize a variable more conservatively

It doesn't matter currently, but thes variable shouldn't be TRUE unless
/i is in effect.

2 years agoregcomp.c: Use a weird value in a place where ignored
Karl Williamson [Sun, 18 Nov 2018 20:39:49 +0000 (13:39 -0700)]
regcomp.c: Use a weird value in a place where ignored

This way, it doesn't confuse that it is legal, and should it stop being
ignored in the called function, it will show up as a problem much
sooner.

2 years agoregexec.c: Add comment
Karl Williamson [Sat, 17 Nov 2018 23:02:31 +0000 (16:02 -0700)]
regexec.c: Add comment

2 years agoregexec.c: Rmv unused macros
Karl Williamson [Sat, 17 Nov 2018 22:54:34 +0000 (15:54 -0700)]
regexec.c: Rmv unused macros

2 years agoregcomp.h: Clarify comments
Karl Williamson [Sun, 18 Nov 2018 23:06:50 +0000 (16:06 -0700)]
regcomp.h: Clarify comments

2 years agoregcomp.c: Consolidate duplicated code into 1 place
Karl Williamson [Thu, 15 Nov 2018 18:09:35 +0000 (11:09 -0700)]
regcomp.c: Consolidate duplicated code into 1 place

2 years agoregcomp.c: Use better method for setting debug offsets
Karl Williamson [Wed, 21 Nov 2018 04:21:44 +0000 (21:21 -0700)]
regcomp.c: Use better method for setting debug offsets

This was changing the parse pointer around some code and restoring it
afterwards.  The purpose must have been to get the debug offsets
correct.  But there is a better way to do that, which doesn't take up
cycles on a non-Debugging build, and that is to set the offsets
directly.

2 years agoregcomp.c: Remove another sizing pass relict
Karl Williamson [Wed, 21 Nov 2018 04:18:51 +0000 (21:18 -0700)]
regcomp.c: Remove another sizing pass relict

We no longer play with the emit ptr in this function, so no need to save
and restore it.

2 years agoMove isPOWER_OF_2() macro to handy.h
Karl Williamson [Sun, 25 Nov 2018 19:14:49 +0000 (12:14 -0700)]
Move isPOWER_OF_2() macro to handy.h

This is in preparation for it to be used outside of the file which
previously defined it.

2 years agoregen/mk_invlists.pl: Generate a new value
Karl Williamson [Sun, 25 Nov 2018 19:12:19 +0000 (12:12 -0700)]
regen/mk_invlists.pl: Generate a new value

The new value is the maximum number of code points that fold to any
single code point.  It will be used in a future commit.

2 years agoRename local variable to prevent confusion with global
James E Keenan [Mon, 26 Nov 2018 17:29:03 +0000 (12:29 -0500)]
Rename local variable to prevent confusion with global

Per:  https://lgtm.com/projects/g/Perl/perl5/alerts/?mode=tree&ruleFocus=2157860312

For: RT # 133686 (partial)

2 years agoRename global variable to prevent confusion with local
James E Keenan [Mon, 26 Nov 2018 17:14:51 +0000 (12:14 -0500)]
Rename global variable to prevent confusion with local

Per:  https://lgtm.com/projects/g/Perl/perl5/alerts/?mode=tree&ruleFocus=2157860312

2 years agoperldelta for 404395d24bc8, 640e129d0fc4 and 85d2f7cacba4
Tony Cook [Mon, 26 Nov 2018 03:21:13 +0000 (14:21 +1100)]
perldelta for 404395d24bc8640e129d0fc4 and 85d2f7cacba4

2 years ago(perl #133659) make an in-place edit successful if the exit status is zero
Tony Cook [Tue, 20 Nov 2018 23:05:27 +0000 (10:05 +1100)]
(perl #133659) make an in-place edit successful if the exit status is zero

during global destruction.

This means that code like:

  perl -i -ne '...; last'

will replace the input file with the in-place edit output of the file,
but:

  perl -i -ne '...; die'

or

  perl -i -ne '...; exit 1'

won't.

2 years ago(perl #133659) tests for global destruction handling of inplace editing
Tony Cook [Tue, 20 Nov 2018 05:43:43 +0000 (16:43 +1100)]
(perl #133659) tests for global destruction handling of inplace editing

2 years ago(perl #133659) move argvout cleanup to a new function
Tony Cook [Tue, 20 Nov 2018 04:30:20 +0000 (15:30 +1100)]
(perl #133659) move argvout cleanup to a new function

2 years agoRemove 1 comparison whose result is always the same.
James E Keenan [Fri, 23 Nov 2018 16:49:03 +0000 (11:49 -0500)]
Remove 1 comparison whose result is always the same.

Per: https://lgtm.com/projects/g/Perl/perl5/alerts/?mode=tree&ruleFocus=2154840804

For: RT 133686 (partial)

2 years agoEliminate empty conditional branch
James E Keenan [Fri, 23 Nov 2018 18:45:25 +0000 (13:45 -0500)]
Eliminate empty conditional branch

Per:  https://lgtm.com/projects/g/Perl/perl5/alerts/?mode=tree&ruleFocus=2154840803

For: RT 133686 (partial)

2 years agoAltaVista is no more.
James E Keenan [Sat, 24 Nov 2018 00:17:38 +0000 (19:17 -0500)]
AltaVista is no more.

Provide a non-Mountain View alternative.

For: RT # 133684

2 years agoSplit NAME line on multiple whitespaces
James E Keenan [Fri, 23 Nov 2018 22:13:59 +0000 (17:13 -0500)]
Split NAME line on multiple whitespaces

For:  RT # 133683

pod/perlmodlib.pod is a file generated by pod/perlmodlib.PL, which is
run by 'miniperl' during 'make'.  That program parses the 'NAME' header
of .pod files and fragments of POD found in 'regen/opcode.pl'.  The POD
for B::Op_private is one such fragment.  Correcting a superfluous
whitespace in that fragment did not suffice to prevent the downstream
formatting error reported in the RT -- an error visible with 'pod2text'
and 'pod2html' as well.  We also had to make the regex which
perlmodlib.PL uses to parse the 'NAME' header more flexible.

2 years agoperlfunc: clarify reset EXPR behaviour
Dagfinn Ilmari Mannsåker [Thu, 22 Nov 2018 12:14:38 +0000 (12:14 +0000)]
perlfunc: clarify reset EXPR behaviour

Mention that it only affects variables in the current package, and
that it affects scalars, arrays and hashes ("variables and arrays"
is just confus(ed|ing)).

2 years agooops, typo
Karen Etheridge [Wed, 21 Nov 2018 17:40:19 +0000 (09:40 -0800)]
oops, typo

2 years agooptimize IV -> UV conversions
Tomasz Konojacki [Wed, 21 Nov 2018 08:26:31 +0000 (09:26 +0100)]
optimize IV -> UV conversions

This commit replaces all instances of code that looks like this:

  uv = (iv == IV_MIN) ? (UV)iv : (UV)(-iv)

with simpler and more optimal:

  uv = -(UV)iv

While -iv indeed results in an undefined behaviour when iv == IV_MIN,
-(UV)iv is perfectly well defined and does the right thing.

C standard guarantees that the result of (UV)iv (for negative iv) is
equal to iv + UV_MAX + 1 (see 6.3.1.3, paragraph 2 in C11). It also
guarantees that the result of -uv is UV_MAX - uv + 1 (6.2.5,
paragraph 9).

That means that the result of -(UV)iv is UV_MAX - (iv + UV_MAX + 1) + 1
which is equal to -iv for *all* possible negative values of iv.

[perl #133677]

2 years agoS_hv_delete_common(): avoid undefined behaviour
David Mitchell [Wed, 21 Nov 2018 12:09:45 +0000 (12:09 +0000)]
S_hv_delete_common(): avoid undefined behaviour

ASAN -fsanitize-undefined was tripping on the second of these two lines:

    svp = AvARRAY(isa);
    end = svp + AvFILLp(isa)+1;

In the case where svp is NULL and AvFILLp(isa) is -1, the first addition
is undefined behaviour. Add the 1 first, so that it becomes
svp + (-1+1), which is safe.

2 years agolgtm.yml: fix erroneous inclusion
Dominic Hargreaves [Wed, 21 Nov 2018 10:49:39 +0000 (10:49 +0000)]
lgtm.yml: fix erroneous inclusion

2 years agoadd entries for Module-CoreList 5.0181220
Karen Etheridge [Tue, 20 Nov 2018 22:46:24 +0000 (14:46 -0800)]
add entries for Module-CoreList 5.0181220

I did this manually; I am not sure if 'perl -Ilib Porting/corelist.pl
cpan' would add these entries on the next blead-point release day.

2 years agobump version of released Module-CoreList
Karen Etheridge [Tue, 20 Nov 2018 22:46:05 +0000 (14:46 -0800)]
bump version of released Module-CoreList

2 years agoBump the perl version in various places for 5.29.6
Karen Etheridge [Tue, 20 Nov 2018 22:24:49 +0000 (14:24 -0800)]
Bump the perl version in various places for 5.29.6

2 years agonew perldelta for 5.29.6
Karen Etheridge [Tue, 20 Nov 2018 22:18:38 +0000 (14:18 -0800)]
new perldelta for 5.29.6

2 years agotick off 5.29.5 release
Karen Etheridge [Tue, 20 Nov 2018 22:17:22 +0000 (14:17 -0800)]
tick off 5.29.5 release

2 years agoepigraph for 5.29.5 release
Karen Etheridge [Tue, 20 Nov 2018 22:16:44 +0000 (14:16 -0800)]
epigraph for 5.29.5 release

2 years agoadd new release to perlhist v5.29.5
Karen Etheridge [Tue, 20 Nov 2018 20:47:18 +0000 (12:47 -0800)]
add new release to perlhist

2 years agofinalize perldelta for 5.29.5
Karen Etheridge [Tue, 20 Nov 2018 20:24:47 +0000 (12:24 -0800)]
finalize perldelta for 5.29.5

2 years agoRMG tweaks
Karen Etheridge [Tue, 20 Nov 2018 20:24:04 +0000 (12:24 -0800)]
RMG tweaks

2 years agofix whitespace
Karen Etheridge [Tue, 20 Nov 2018 20:23:54 +0000 (12:23 -0800)]
fix whitespace

2 years agoupdate list of customized files
Karen Etheridge [Tue, 20 Nov 2018 20:19:07 +0000 (12:19 -0800)]
update list of customized files

2 years agoUpdate Module::Corelist for 5.29.5
Karen Etheridge [Tue, 20 Nov 2018 19:36:53 +0000 (11:36 -0800)]
Update Module::Corelist for 5.29.5

2 years ago5.22 and 5.24 are now outside the regular release window
Karen Etheridge [Tue, 20 Nov 2018 18:57:43 +0000 (10:57 -0800)]
5.22 and 5.24 are now outside the regular release window

2 years agoregcomp.c: Rmv malformed assert()
Karl Williamson [Tue, 20 Nov 2018 15:55:43 +0000 (08:55 -0700)]
regcomp.c: Rmv malformed assert()

This had a plain '=' instead of an '==', thus setting the value in the
process of asserting it, hence would always be true.  But changing it to
'==' causes the assertion to fail in various cases.

I need to rethink this, so in the meantime am simply removing it.

Spotted by Dave Mitchell++

2 years agot/perf/benchmarks.t: improve do error checks
David Mitchell [Tue, 20 Nov 2018 10:59:22 +0000 (10:59 +0000)]
t/perf/benchmarks.t: improve do error checks

Make the checks for "do 't/perf/benchmarks'" look more like those
suggested for 'do' in perlfunc.

In particular, this may help track down the issue in RT #133663.

2 years agoMake Errno_pm.PL compatible with /usr/include/<ARCH>/errno.h
Niko Tyni [Sat, 17 Nov 2018 17:27:42 +0000 (19:27 +0200)]
Make Errno_pm.PL compatible with /usr/include/<ARCH>/errno.h

As seen in <https://bugs.debian.org/798955>, Debian glibc
maintainers intend to move system header files from /usr/include to
/usr/include/<arch> at some point. This would break Errno_pm.PL, which
has logic for asking cpp for the location of errno.h but fails earlier
if errno.h is not on a list of known paths.

Take the cpp fallback instead of dying. The behaviour should stay
identical as long as errno.h is not moved.

This will also enable multiarch (non-sysroot) cross builds.

Original patch by Helmut Grohne.

Bug-Debian: https://bugs.debian.org/875921