This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
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.
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.
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.
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)
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
Tony Cook [Mon, 26 Nov 2018 03:21:13 +0000 (14:21 +1100)]
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.
Tony Cook [Tue, 20 Nov 2018 05:43:43 +0000 (16:43 +1100)]
(perl #133659) tests for global destruction handling of inplace editing
Tony Cook [Tue, 20 Nov 2018 04:30:20 +0000 (15:30 +1100)]
(perl #133659) move argvout cleanup to a new function
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)
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)
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
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.
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)).
Karen Etheridge [Wed, 21 Nov 2018 17:40:19 +0000 (09:40 -0800)]
oops, typo
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]
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.
Dominic Hargreaves [Wed, 21 Nov 2018 10:49:39 +0000 (10:49 +0000)]
lgtm.yml: fix erroneous inclusion
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.
Karen Etheridge [Tue, 20 Nov 2018 22:46:05 +0000 (14:46 -0800)]
bump version of released Module-CoreList
Karen Etheridge [Tue, 20 Nov 2018 22:24:49 +0000 (14:24 -0800)]
Bump the perl version in various places for 5.29.6
Karen Etheridge [Tue, 20 Nov 2018 22:18:38 +0000 (14:18 -0800)]
new perldelta for 5.29.6
Karen Etheridge [Tue, 20 Nov 2018 22:17:22 +0000 (14:17 -0800)]
tick off 5.29.5 release
Karen Etheridge [Tue, 20 Nov 2018 22:16:44 +0000 (14:16 -0800)]
epigraph for 5.29.5 release
Karen Etheridge [Tue, 20 Nov 2018 20:47:18 +0000 (12:47 -0800)]
add new release to perlhist
Karen Etheridge [Tue, 20 Nov 2018 20:24:47 +0000 (12:24 -0800)]
finalize perldelta for 5.29.5
Karen Etheridge [Tue, 20 Nov 2018 20:24:04 +0000 (12:24 -0800)]
RMG tweaks
Karen Etheridge [Tue, 20 Nov 2018 20:23:54 +0000 (12:23 -0800)]
fix whitespace
Karen Etheridge [Tue, 20 Nov 2018 20:19:07 +0000 (12:19 -0800)]
update list of customized files
Karen Etheridge [Tue, 20 Nov 2018 19:36:53 +0000 (11:36 -0800)]
Update Module::Corelist for 5.29.5
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
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++
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.
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
Tony Cook [Mon, 19 Nov 2018 23:25:59 +0000 (10:25 +1100)]
James Clarke is now a perl author
James Clarke [Mon, 19 Nov 2018 14:25:56 +0000 (14:25 +0000)]
Also work around renameat() kernel bug on GNU/kFreeBSD
Karl Williamson [Mon, 19 Nov 2018 20:59:56 +0000 (13:59 -0700)]
Allow forcing use of POSIX 2008 locale fcns
These thread-safe functions are not normally used on unthreaded builds,
retaining the use of the library functions that have long been used.
But, it is now possible to tell Configure to use them on unthreaded
builds.
Karl Williamson [Mon, 19 Nov 2018 20:55:04 +0000 (13:55 -0700)]
t/harness: Run tests for IO::Zlib sequentially
Most of these failed for me in one run inexplicably. This typically
means there was a glitch, and its likely to be that the tests somehow
interferred with each other. Rather than take the time to investigate
further, I changed harness to run the tests for this distribution
sequentially.
Karl Williamson [Sun, 18 Nov 2018 20:18:49 +0000 (13:18 -0700)]
PATCH: [perl #133649] fails on OpenBSD-6.4 unthreaded
OpenBSD has a (perfectly legal) different syntax for the string
parameter to setlocale(), so the failing tests are not actually valid on
that platform. Rather than go to the significant effort to create a
Configure probe to find out what platforms use what syntax, simply skip
these on this platform. The tests aren't skipped if built with threads,
as they actually help make sure that the code that deals with different
syntaxes for thread-safe handling of locales works in the face of
different syntaxes
Dominic Hargreaves [Mon, 19 Nov 2018 19:17:17 +0000 (19:17 +0000)]
lgtm.yml: work around some incorrect classification
David Mitchell [Mon, 19 Nov 2018 16:28:03 +0000 (16:28 +0000)]
perlguts: clarify SV types which are scalars
The '< SVt_PVAV' entry looked to one reader like malformed HTML
rather than indicating a numerical range.
http://nntp.perl.org/group/perl.perl5.porters/252585
David Mitchell [Mon, 19 Nov 2018 14:12:05 +0000 (14:12 +0000)]
ext/File-Find: support parallel testing
t/harness was recently modified to run tests under ext/ etc in parallel.
ext/File-Find/t/ has two test scripts which both use the same temporary
directory names.
Make taint.t use different names, so that it can run in parallel with
the other script.
David Mitchell [Mon, 19 Nov 2018 13:52:46 +0000 (13:52 +0000)]
ext/GDBM_File/t/fatal.t: support parallel testing
t/harness was recently modified to run tests under ext/ etc in parallel.
ext/GDBM_File/t/ has two test scripts which both use the same filename.
Make fatal.t use a different name, so that it can run in parallel with
the other script.
David Mitchell [Mon, 19 Nov 2018 12:38:27 +0000 (12:38 +0000)]
autodoc.pl: escape POD
RT #133638
This script generates perlapi.pod, and contains snippets of POD
which it inserts into that file. The metacpan web site was interpreting
this as pod for autodoc.pl and displaying it.
Escape the pod by prefixing each line with '|'.
Chris 'BinGOs' Williams [Mon, 19 Nov 2018 11:12:22 +0000 (11:12 +0000)]
Update Maintainers.pl to match reality
David Mitchell [Mon, 19 Nov 2018 08:34:40 +0000 (08:34 +0000)]
perldelta for davem's commits
Tony Cook [Mon, 19 Nov 2018 04:04:34 +0000 (15:04 +1100)]
perldelta for
dda4a47798d6
Tony Cook [Mon, 19 Nov 2018 03:54:46 +0000 (14:54 +1100)]
Tony Cook [Mon, 19 Nov 2018 03:47:14 +0000 (14:47 +1100)]
perldelta for
191f8909fa4e
Tony Cook [Mon, 19 Nov 2018 03:04:20 +0000 (14:04 +1100)]
(perl # 132147) improve robustness against corrupt SDBM databases
This merge makes a few changes to the SDBM database handling:
- in a few places, a corrupt page could be loaded, but despite
failing validation, it would still be cached, so a second call
would try to use the corrupt page, causing buffer overflows
- some code didn't validate on page load at all.
- adds three extra checks to the page validator
Tony Cook [Mon, 19 Nov 2018 02:58:33 +0000 (13:58 +1100)]
(perl #132147) only test corrupt dbs on archs that match
The files were generated for little-endian, sizeof(short) == 2 platforms,
only run those tests on such platforms.
Tony Cook [Wed, 7 Nov 2018 00:16:10 +0000 (11:16 +1100)]
(perl #132147) add extra block validation checks
and a few extra tests that fuzz testing found.
Tony Cook [Tue, 6 Nov 2018 03:23:48 +0000 (14:23 +1100)]
(perl #132147) don't cache invalid pages
When sdbm loads its page buffer from disk, in most cases it validates
the page and doesn't continue processing if it fails validation.
Unfortunately, in a few places it still marked the buffer as loaded
from that page, and later calls would then use that cached page,
causing a variety of problems, including buffer read overflows.
sdbm_firstkey() didn't validate the loaded page at all, it now does.
All places that validate the loaded page now on a failed validation:
- invalidate the cached page (set pagbno to -1)
- set the I/O error flag on the database object
- set errno ($!) to EINVAL
The first ensures that later calls don't end up using an invalid cached
page.
The others allow the caller to check whether an error has occurred.
Tony Cook [Tue, 6 Nov 2018 03:12:53 +0000 (14:12 +1100)]
(perl #132147) add tests for corrupt files from tickets
Karl Williamson [Thu, 15 Nov 2018 17:57:24 +0000 (10:57 -0700)]
Add regnode NANYOFM
This matches when the existing node ANYOFM would not match; i.e., they
are complements.
I almost didn't create this node, but it turns out to significantly
speed up various classes of matches. For example qr/[^g]/, both /i and
not, turn into this node; and something like
(("a" x $large_number) . "b") =~ /[^a]/
goes through the string a word at a time, instead of previously
byte-by-byte. Benchmarks are at the end of this mesage.
This node gets generated when complementing any single ASCII character
and when complementing any ASCII case pair, like /[^Gg]/. It never gets
generated if the class includes a character that isn't ASCII (actually
UTF-8 invariant, which matters only on EBCDIC platforms).
The details of when this node gets constructed are complicated. It
happens when the bit patterns of the characters in the class happen to
have certain very particular characteristics, depending on the vagaries
of the character set. [BbCc] will do so, but [AaBb] does not. [^01]
does, but not [^12]. Precisely, look at all the bit patterns of the
characters in the set, and count the total number of differing bits,
calling it 'n'. If and only if the number of characters is 2**n, this
node gets generated. As an example, on both ASCII and EBCDIC, the last
4 bits of '0' are 0000; of '1' are 0001; of '2' are 0010; and of '3' are
0011. The other 4 bits are the same for each of these 4 digits. That
means that only 2 bits differ among the 4 characters, and 2**2==4, so
the NANYOFM node will get generated. Similarly, 8=1000 and 0=0000
differ only in one bit so 2**1==2, and so [^08] will generate this node.
We could consider in the future, an extension where, if the input
doesn't work to generate this node, that we construct the closure of
that input to generate this node, which would have false positives that
would have to be tested for. The speedup of this node is so significant
that that could still be faster than what we have today.
The benchmarks are for a 64-bit word. 32-bits would not be as good.
Key:
Ir Instruction read
Dr Data read
Dw Data write
COND conditional branches
IND indirect branches
The numbers (except for the final column) represent raw counts per loop
iteration. The higher the number in the final column, the faster.
(('a' x 1) . 'b') =~ /[^a]/
blead nanyof Ratio %
-------- -------- --------
Ir 2782.0 2648.0 105.1
Dr 845.0 799.0 105.8
Dw 531.0 500.0 106.2
COND 431.0 419.0 102.9
IND 22.0 22.0 100.0
(('a' x 10) . 'b') =~ /[^a]/
blead nanyof Ratio %
-------- -------- --------
Ir 3358.0 2671.0 125.7
Dr 998.0 801.0 124.6
Dw 630.0 500.0 126.0
COND 503.0 424.0 118.6
IND 22.0 22.0 100.0
(('a' x 100) . 'b') =~ /[^a]/
blead nanyof Ratio %
-------- -------- --------
Ir 9118.0 2773.0 328.8
Dr 2528.0 814.0 310.6
Dw 1620.0 500.0 324.0
COND 1223.0 450.0 271.8
IND 22.0 22.0 100.0
(('a' x 1000) . 'b') =~ /[^a]/
blead nanyof Ratio %
-------- -------- --------
Ir 66718.0 3650.0 1827.9
Dr 17828.0 923.0 1931.5
Dw 11520.0 500.0 2304.0
COND 8423.0 668.0 1260.9
IND 22.0 22.0 100.0
(('a' x 10000) . 'b') =~ /[^a]/
blead nanyof Ratio %
-------- -------- --------
Ir 642718.0 12650.0 5080.8
Dr 170828.0 2048.0 8341.2
Dw 110520.0 500.0 22104.0
COND 80423.0 2918.0 2756.1
IND 22.0 22.0 100.0
(('a' x 100000) . 'b') =~ /[^a]/
blead nanyof Ratio %
-------- -------- --------
Ir Inf 102654.8 6237.1
Dr Inf 13299.3 12788.9
Dw Inf 500.9 219708.7
COND 800424.1 25419.1 3148.9
IND 22.0 22.0 100.0
Karl Williamson [Thu, 15 Nov 2018 17:56:31 +0000 (10:56 -0700)]
regexec.c: Fix logic error
The function S_find_next_masked() could return a pointer to something
that wasn't wanted, returning prematurely due to a logic error I made.
This erroneous code is in 5.28.0, but I couldn't figure out any actual
bugs this caused, due to the circumstances it is called under.
The bug is I should have used 'xor' instead of complement and 'and'.
Thus trying to find 0x2f, with a mask of all F's also found 2e.
Karl Williamson [Fri, 16 Nov 2018 17:48:51 +0000 (10:48 -0700)]
Merge branch 'fixup after regcomp sizing pass removal' into blead
Having a sizing pass for compiling regular expression patterns forced
various other design decisions that are now no longer necessary, since
the sizing pass has been eliminated.
This series of commits removes a bunch of them, simplifying the code
Karl Williamson [Tue, 13 Nov 2018 21:17:37 +0000 (14:17 -0700)]
regcomp.c: Simplify early failure returns
Previous commits have removed the need for certain macros and generality
in returning from functions early. Correspondingly simplify
Karl Williamson [Wed, 7 Nov 2018 05:49:51 +0000 (22:49 -0700)]
regcomp.c: Remove no longer used parameter, and refactor
This static function no longer is called with a non-NULL final
parameter. That means it no longer returns a list, and its name is
hereby changed to reflect that. It also means the function can be
refactored and made simpler.
Karl Williamson [Wed, 7 Nov 2018 01:44:46 +0000 (18:44 -0700)]
regcomp.c: Remove now always NULL parameter
This parameter is always NULL. No need to have it in this static
function
Karl Williamson [Wed, 7 Nov 2018 01:26:39 +0000 (18:26 -0700)]
regcomp.c: Don't restart parse for /d to /u if no need to
This commit keeps track of if there are any operations encountered which
differ under /d from /u. If we switch to /u and haven't so far found
anything which differs, there's no need to reparse
Karl Williamson [Wed, 7 Nov 2018 01:10:36 +0000 (18:10 -0700)]
regcomp.c: Don't restart parse for /d to /u if reparsing anyway
Prior to this commit, if the rules changed from /d to /u, the parse was
immediately restarted. This commit changes that so that it doesn't do
this if it is known that the parse will be redone anyway, but a full
parse needs to done first in order to count the parentheses.
Doing this can avoid the need for an almost full extra reparse.
Karl Williamson [Wed, 7 Nov 2018 01:02:07 +0000 (18:02 -0700)]
regcomp.c: Don't restart parse now if doing so later
Prior to this commit, if it became apparent that long branches were
going to be needed, the parse was immediately restarted. This commit
changes that so that it doesn't do this if it is known that the parse
will be redone anyway, but a full parse needs to done first in order to
count the parentheses.
This can avoid an almost complete reparse in some situations.
Karl Williamson [Wed, 7 Nov 2018 00:41:18 +0000 (17:41 -0700)]
regcomp.c: Swap 'if' branches for readability
It's easier to understand if the simplest case is first in the code.
Karl Williamson [Wed, 7 Nov 2018 00:31:21 +0000 (17:31 -0700)]
regcomp.c: Refactor constructing EXACTish nodes
The previous commits have allowed us to refactor this to eliminate
redundancies.
Previously, the same logic was done separately for UTF-8 and non-UTF-8
patterns. This refactors so the logic is done once. The details differ
for UTF-8 and non-UTF-8. So that's where the differences lie, in the
details without having to duplicate the logic.
Karl Williamson [Tue, 6 Nov 2018 17:03:00 +0000 (10:03 -0700)]
regcomp.c: Fix up parsing \N{} in a string
\N{} changes /d to /u, and may require reparsing of the current node to
fix wrong assumptions.
This commit is necessary for the simplifications achieved in the next
commit.
Karl Williamson [Sat, 3 Nov 2018 16:03:37 +0000 (10:03 -0600)]
regcomp.c: Remove obsolete code
This code was obsoleted by removal of the sizing pass. Previously we
had to take special care when encountering the LATIN SMALL LETTER SHARP
S because it can fold to more bytes than it occupies. But with the
sizing pass gone, that is no longer necessary.
Karl Williamson [Sat, 3 Nov 2018 15:41:52 +0000 (09:41 -0600)]
regcomp.c: Comments, white-space, rmv extra parens
This commit re-indents things after the previous commit added a block,
fixes typos in comments, and removes obsolete references in them to the
sizing pass, and adds some comments, and does some white-space changes.
In one case it removes extraneous parentheses
Karl Williamson [Thu, 1 Nov 2018 15:08:04 +0000 (09:08 -0600)]
regcomp.c: Remove no longer useful code
This code has been obsoleted by the previous commit. That commit looks
at a bracketed character class in general and optimizes it to some
faster and/or simpler operation if possible. The code being removed in
this commit was originally added to try to find some optimizations that
were feasible to find in the sizing pass. Now that we don't have a
sizing pass, and we find optimizations generally, this code doesn't add
any value.
Karl Williamson [Thu, 1 Nov 2018 07:43:39 +0000 (01:43 -0600)]
Find optimizations for /[[:posix:]]/a
Various optimizations are done when the regular expression compiler sees
a bracketed character class. For example, /[a]/ is optimized into /a/.
This wasn't done for the various POSIX classes under /a, as the speed of
the operations of using a regular bracketed class (which uses a bitmap)
and of an optimized version (which uses a specialized opcode for the
POSIX class) is similar. The only advantage would have been that the
specialized opcode is 1/10 the size of the bitmap. But the optimization
in general couldn't come until the second pass, after the size had
already been calculated and space allocated. So there was no savings.
But now that there is no separate sizing pass, doing the optimization
actually will save space.
Karl Williamson [Mon, 12 Nov 2018 04:54:41 +0000 (21:54 -0700)]
regcomp.c: Add assertion
Karl Williamson [Wed, 14 Nov 2018 16:09:38 +0000 (09:09 -0700)]
regcomp.c: Fix up RE_TRACK_PATTERN_OFFSETS
These need to be changed around as a result of removing the sizing pass
from pattern compilation.
The first element in the array is the number of offsets. This had
become wrong. And it is used instead of the program length when it is
available.
Karl Williamson [Sat, 20 Oct 2018 23:24:53 +0000 (17:24 -0600)]
regcomp.c: Avoid some conditionals
A pattern being UTF-8 implies it is /u. By proper initialization of if
it is /u or not, we can avoid the existing additional tests for UTF-8 in
those places where we care about /u but don't care about UTF-8ness.
Karl Williamson [Mon, 29 Oct 2018 03:24:22 +0000 (21:24 -0600)]
regcomp.c: Make sure UTF-8 regex pattern uses /u
When a pattern is in UTF-8, Unicode rules should be selected. This
commit makes sure that this happens and that the displayable form of the
pattern shows /u.
I don't know of any bugs this fixes.
Karl Williamson [Thu, 8 Nov 2018 03:22:36 +0000 (20:22 -0700)]
PATCH: [perl #133642] Double free
This was caused by doing a SAVEFREEPV twice. The solution is to not do
this twice.
But this means that if the process unexpectedly dies, there is a
potential memory leak. That potential already exists with other
variables, and has its own ticket #133589.
Karl Williamson [Thu, 8 Nov 2018 03:07:51 +0000 (20:07 -0700)]
regcomp.c: Refactor to remove an else and a NOT_REACHED
This just simplifies things a bit.
Karl Williamson [Thu, 8 Nov 2018 03:20:53 +0000 (20:20 -0700)]
regcomp.c: calculate variants instead of assuming worst case
When converting a byte pattern to UTF-8, the needed size may increase due
to some bytes (the UTF-8 variants) occupying two bytes instead of one
under UTF-8.
Prior to this commit, the pattern was assumed to contain only variants,
and enough memory was allocated for the worst case.
This commit actually calculates how much space is needed and allocates
only that.
There is extra work involved in doing this calculation. But the pattern
is parsed per-word. For short strings, it doesn't much matter either
way. But for very long strings, it seems to me the consequences of
potentially allocating way too much memory out weighs the negative of
this extra work. If field experience proves me wrong, then revert this
commit.
Karl Williamson [Thu, 8 Nov 2018 03:11:50 +0000 (20:11 -0700)]
XXX utf8.c: calculate vairants instead of assuming worst case
When converting a byte string to UTF-8, the needed size may increase due
to some bytes (the UTF-8 variants) occupying two bytes instead of one
under UTF-8.
Prior to this commit, the string was assumed to contain only variants,
and enough memory was allocated for the worst case, then the excess was
returned at the end.
This commit actually calculates how much space is needed and allocates
only that, so there is no need to trim afterwards.
There is extra work involved in doing this calculation. But the string
is parsed per-word. For short strings, it doesn't much matter either
way. But for very long strings, it seems to me the consequences of
potentially allocating way too much memory out weighs the negative of
this extra work.
Karl Williamson [Mon, 12 Nov 2018 04:48:53 +0000 (21:48 -0700)]
regcomp.sym: longj field is a boolean
The comments could lead one to thinking one could specify any of the
argument fields that nodes can have. But in fact, the value is a
boolean, 0 meaning to use the normal offset field of all regnodes; and 1
meaning to use the ARG field that some regnodes have. If a regnode had
more than just the one argument field, the one that corresponds to that
would be used.
This commit enforces that, and changes regcomp.sym to not use '2',
which is misleading.
It clarifies the comments about this and what '.' means in the flags
field
Karl Williamson [Thu, 8 Nov 2018 01:44:56 +0000 (18:44 -0700)]
t/re/reg_mesg.t: Add test
Verify this still works after the recent removal of the sizing pass
Karl Williamson [Mon, 12 Nov 2018 04:42:51 +0000 (21:42 -0700)]
-Drv now turns on all regex debugging
This commit makes the v (verbose) modifier to -Dr do something: turn on
all possible regex debugging.
Karl Williamson [Mon, 12 Nov 2018 04:38:29 +0000 (21:38 -0700)]
regcomp.h: Delete duplicate macro defn
Karl Williamson [Sun, 11 Nov 2018 22:59:14 +0000 (15:59 -0700)]
perl.h: White-space, comment
Karl Williamson [Sun, 11 Nov 2018 18:31:17 +0000 (11:31 -0700)]
re/re_tests: Add test
Karl Williamson [Thu, 8 Nov 2018 01:40:37 +0000 (18:40 -0700)]
handy.h: Add some comments
This allows us to remove a comment in regcomp.c
Karl Williamson [Wed, 14 Nov 2018 16:21:04 +0000 (09:21 -0700)]
perlrun: Clarify -Dv
Karl Williamson [Tue, 6 Nov 2018 16:51:53 +0000 (09:51 -0700)]
t/re/pat.t: Add a test
Dominic Hargreaves [Thu, 15 Nov 2018 12:13:05 +0000 (12:13 +0000)]
lgtm.yml: classify charclass_invlists.h as generated
This file represents a significant chunk of the line count of the project
and so excluding it results in more realistic statistics.
James E Keenan [Wed, 14 Nov 2018 21:29:46 +0000 (16:29 -0500)]
Add ext/File-Find/t to list of badly-behaved test directories.
For: RT # 133658
Dominic Hargreaves [Tue, 6 Nov 2018 16:55:41 +0000 (16:55 +0000)]
Enable LGTM.com integration
Committer: Update MANIFEST. Provide additional email address for
contributor.
Karl Williamson [Wed, 25 Jul 2018 02:26:39 +0000 (20:26 -0600)]
Add more parallelism to t/harness
This commit causes test files in cpan/, etc to run in parallel provided
there is no file in the test directory whose name begins with zero.
Experience shows that things like 01test, 02test, ... are supposed to be
executed serially. Sometimes there is a single file beginning with 0,
and this is supposed to be executed first as setup for the remaining
tests (which probably could be executed in parallel, but that
enhancement is much harder to do, so isn't tried here)
This is a heuristic, and this commit adds the ability to explicitly
specify directories to the serial list that don't correspond to the
above rule. One directory is currently on that list: ext/Pod-Html/t.
It follows a different paradigm to order things. We could rename the
tests to follow the normal paradigm since this is in ext/, but I thought
it best to keep it as an example of what to do should the need for other
exceptions arise.
This can save a bunch of wallclock time on slower systems with many
cores, such as dromedary. On that system, the test suite finishes 17%
faster with this commit on the first run. (This is a savings of over
100 wallclock seconds; a very noticeable improvement.) On subsequent
runs when it knows approximately how long each test takes and sorts the
order accordingly, the suite runs 8% faster.
On machines with few cores, there isn't much of a difference.
Dan Dedrick [Fri, 13 Oct 2017 01:49:39 +0000 (21:49 -0400)]
Fix missing build dependency for pods
When building perl with highly parallel options (e.g. -j 32) on a machine
with many cores (e.g. 32) ocassionaly it fails with the following type
of error.
make[1]: Entering directory '.../cpan/podlators'
Can't locate Getopt/Long.pm in @INC (you may need to install the Getopt::Long module) (@INC contains: .../cpan/AutoLoader/lib .../dist/Carp/lib .../dist/PathTools .../dist/PathTools/lib .../cpan/ExtUtils-Install/lib .../cpan/ExtUtils-MakeMaker/lib .../cpan/ExtUtils-Manifest/lib .../cpan/File-Path/lib .../ext/re .../dist/Term-ReadLine/lib .../dist/Exporter/lib .../ext/File-Find/lib .../cpan/Text-Tabs/lib .../dist/constant/lib .../cpan/version/lib .../lib ../../lib .) at .../cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm line 109.
Makefile:445: recipe for target 'manifypods' failed
make[1]: *** [manifypods] Error 2
The scripts pod2man, pod2text, podchecker, podselect, and pod2usage all use
Getopt-Long and since they are all part of nonxs modules this needs to be
added here to prevent these build races.
Sawyer X [Sun, 11 Nov 2018 08:54:10 +0000 (10:54 +0200)]
Adding Zak for March release
James E Keenan [Sat, 10 Nov 2018 02:21:30 +0000 (21:21 -0500)]
Ensure same count of tests on different OSes.
On OpenBSD (in at least one instance), $different was false, thereby causing 30 tests not to be run but without reflecting that skipping in the test count displayed at the end of output.
Let's put this in a SKIP block similar to those used elsewhere in the file.
Sawyer X [Sat, 10 Nov 2018 10:06:59 +0000 (12:06 +0200)]
Bump Data::Dumper to 2.173 (no real change):
The change will happen in the Makefile.PL which is generated and
released. It is generated automatically, so we can't actually inject
the parts that we want.
The way I handle it at the moment is:
* Build perl
* Copy Data::Dumper to other directory
* Grab MANIFEST.SKIP and Makefile.PL from previous release
* Add the DEFINE we need to fix this:
# In WriteMakefile(...)
DEFINE => '-DUSE_PPPORT_H',
* perl Makefile.PL && make && make test && make dist
* Retest the tarball
* Release to CPAN
But we need this bump anyway, so this commit.
Karl Williamson [Mon, 5 Nov 2018 18:01:35 +0000 (11:01 -0700)]
ext/re/t/qr.t: Rmv extraneous Debug statement
It looks like this statement to turn on Debugging was used to help debug
the issues that this test now tests, and should have been removed when
the file was first commited. But no harm came, as no debugging output
got generated.
This was changed by commit
15cab4d70522286feb2fcb1e7313b2f995343181,
"Remove references to passes from regex compiler". It unknowingly fixed
a bug wherein a Debug statement didn't get output. That cause qr.t to
output that debugging statement.
The fix is to simply remove the call for Debugging from qr.t
David Mitchell [Mon, 5 Nov 2018 12:29:27 +0000 (12:29 +0000)]
Don't localise array / hash slice ref assignment
RT #133538
The experimental ref assignment aliasing feature, when applied to
array or hash slices, was treating the slice as if it was always localized;
e.g.
\(@a[3,5,7]) = \(....);
was being interpreted as
local \(@a[3,5,7]) = \(....);
The fix is simple: check for the OPpLVAL_INTRO flag actually being set
on the op, rather than unconditionally localising the array/hash
elements.
Tony Cook [Wed, 24 Jan 2018 04:10:10 +0000 (15:10 +1100)]
(perl #132147) bump *DBM_File versions
Tony Cook [Wed, 24 Jan 2018 04:03:39 +0000 (15:03 +1100)]
(perl #132147) add security warnings to the *DBM_File modules
Tomasz Konojacki [Mon, 15 Oct 2018 03:24:27 +0000 (05:24 +0200)]
pp_divide: use modulo instead of multiplication
On most architectures with hardware integer division (like
x86 or aarch64), division instruction returns both the remainder
and the quotient. It means that performing modulo operation
immediately after division using the same operands is 100% free.
Essentially this commit changes "div" and "mul" into a single "div"
instruction, which results in minor speed up.
[perl #133511]