This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Tony Cook [Thu, 1 Nov 2018 02:44:52 +0000 (13:44 +1100)]
prevent t/Functions.t from warning on undefined values when none supplied
James E Keenan [Wed, 31 Oct 2018 23:03:19 +0000 (19:03 -0400)]
Handle OSes where filesystems can be mounted with 'noatime' option
Adapted from http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/lang/perl5/patches/patch-ta?rev=1.6&content-type=text/x-cvsweb-markup
For readability, change a 'skip' whose block lacked tests to be skipped
with a simple 'pass'.
For RT 132663
Karl Williamson [Wed, 31 Oct 2018 16:22:03 +0000 (10:22 -0600)]
PATCH: [perl #133620] heap buffer overflow
This happens when an alternate parse string is constructed, and the
error message needs to be translated into the terms of the original one,
the error is just past the right edge. The translation was not getting
done. Simply use the original terms.
James E Keenan [Mon, 29 Oct 2018 21:56:20 +0000 (17:56 -0400)]
Move subroutine definition to end of file.
Thereby improving readability of main program.
James E Keenan [Mon, 29 Oct 2018 21:39:48 +0000 (17:39 -0400)]
Regularize indents within subroutine definition.
Over decades, the code within the subroutine acquired many different
combinations of tabs and whitespace for indents, thereby making the code
less readable. Standardize on 4 whitespaces.
For readability, comment end of two blocks.
James E Keenan [Mon, 29 Oct 2018 21:34:22 +0000 (17:34 -0400)]
Fully encapsulate check_utime_result()
This will permit us to move the subroutine's definition to the end of
the file, thereby improving readability of main program.
James E Keenan [Mon, 29 Oct 2018 21:19:07 +0000 (17:19 -0400)]
Remove code commented out since March 2002.
Align indents after removal of comments.
James E Keenan [Mon, 29 Oct 2018 21:07:09 +0000 (17:07 -0400)]
Repeatedly hard-coding an integer is a mistake.
Place
500000000 in variable $ut.
James E Keenan [Mon, 29 Oct 2018 21:00:50 +0000 (17:00 -0400)]
Make descriptions more self-documenting
So that while debugging we can see which 'atime' and 'utime' cases we
are handling.
James E Keenan [Mon, 29 Oct 2018 20:44:31 +0000 (16:44 -0400)]
Add notes so it's easier to see where we are in test file.
James E Keenan [Mon, 29 Oct 2018 20:35:35 +0000 (16:35 -0400)]
Use t/test.pl's note() function
... rather than print(), for informational statements.
H.Merijn Brand [Tue, 30 Oct 2018 16:41:37 +0000 (17:41 +0100)]
Add minix hints to MANIFEST
H.Merijn Brand [Tue, 30 Oct 2018 16:39:33 +0000 (17:39 +0100)]
Add initial support for Minix3
Patch by Sevan Janiyan
Include a hints file for Minix, derived from the NetBSD one but stripped
back to remove most of the legacy parts.
Pali [Fri, 28 Sep 2018 11:17:01 +0000 (13:17 +0200)]
Define also Perl's calloc() macro
Functions malloc(), realloc() and free() are already redefined to
PerlMem_malloc(), PerlMem_realloc() and PerlMem_free(). But calloc() not.
This leads to the problem that memory by calloc() is allocated by system
C library, but freed by Perl's PerlMem_free() which just cause memory
corruptions.
James E Keenan [Mon, 29 Oct 2018 00:29:14 +0000 (20:29 -0400)]
Note locales available and those used in tests.
This will facilitate diagnosis of problems on platforms where tests in
this file are failing.
Phil Pearl (Lobbes) [Fri, 26 Oct 2018 17:34:26 +0000 (13:34 -0400)]
remove extra 'be' in perlre pod
Committer: Add author.
Dagfinn Ilmari Mannsåker [Thu, 23 Nov 2017 11:29:19 +0000 (11:29 +0000)]
Cast away const from AIX' accessx() path argument
Unlike every other platform's access() or equivalent (and as required
by POSIX), AIX doesn't declare the path argument to access() and
accessx() as const char*, so cast the const away.
Tony Cook [Mon, 22 Oct 2018 04:22:47 +0000 (15:22 +1100)]
(perl #133604) fix binmode on Win32 :crlf layers
On Win32 the :crlf layer is special - it replaces the use of the normal
:perlio buffering layer.
So while binmode :raw with :crlf present on non-Win32 removes the
CRLF layer, on Win32 it simply switches the :crlf layer's CRLF flag off
to prevent translation.
Unfortunately the :crlf skipped doing something else expected by :raw -
it didn't turn off the layer UTF8 flag. This broke the tests I added
in
9704d779004.
Tony Cook [Mon, 22 Oct 2018 02:24:48 +0000 (13:24 +1100)]
(perl #133604) test for binmode removing :utf8
Tony Cook [Sun, 21 Oct 2018 22:44:57 +0000 (09:44 +1100)]
(perl #133604) skip a new test on Win32 that fails only on Win32
9704d779 added tests for the apparently completely untested behaviour
of recv() and send() on handles marked as :utf8.
On Win32 the binmode calls used to strip :utf8 for further testing
don't remote :utf8, and the following calls to send() and recv() die.
Hopefully this patch will be reverted soon once binmode is fixed.
Tony Cook [Sat, 20 Oct 2018 23:40:46 +0000 (10:40 +1100)]
Using #ifdef inside macro arguments confuses VC++ 2008
This caused compilation errors for me when building with the
Windows 7 SDK packaged version of MSVC.
Aaron Crane [Sat, 20 Oct 2018 15:07:16 +0000 (16:07 +0100)]
Bump version of Module::CoreList in Maintainers.pl
Aaron Crane [Sat, 20 Oct 2018 14:43:30 +0000 (15:43 +0100)]
Bump the Perl version for 5.29.5
Aaron Crane [Sat, 20 Oct 2018 14:32:02 +0000 (15:32 +0100)]
Create new perldelta for 5.29.5-to-be
Aaron Crane [Sat, 20 Oct 2018 14:28:55 +0000 (15:28 +0100)]
Tick off 5.29.4 release
Aaron Crane [Sat, 20 Oct 2018 14:28:31 +0000 (15:28 +0100)]
Epigraph for 5.29.4 release
Aaron Crane [Sat, 20 Oct 2018 14:25:18 +0000 (15:25 +0100)]
Merge branch 'release-5.29.4' into blead
Aaron Crane [Sat, 20 Oct 2018 12:29:17 +0000 (13:29 +0100)]
Finalize perldelta for 5.29.4
Aaron Crane [Sat, 20 Oct 2018 12:29:01 +0000 (13:29 +0100)]
Update Module::Corelist for 5.29.4
Karl Williamson [Sat, 20 Oct 2018 06:10:25 +0000 (00:10 -0600)]
Merge branch 'remove sizing pass' into blead
Karl Williamson [Sat, 20 Oct 2018 03:41:35 +0000 (21:41 -0600)]
perldelta
Karl Williamson [Fri, 19 Oct 2018 20:55:35 +0000 (14:55 -0600)]
regcomp.c: White space only
This out/indents the blocks that were removed/added by the previous
commit
Karl Williamson [Fri, 19 Oct 2018 17:39:57 +0000 (11:39 -0600)]
Remove references to passes from regex compiler
The previous commit removed the sizing pass, but to minimize the
difference listing, it left in all the references it could to the
various passes, with the first pass set to FALSE. This commit now
removes those references, as well as to some variables that are no
longer used.
Karl Williamson [Fri, 19 Oct 2018 15:48:34 +0000 (09:48 -0600)]
Remove sizing pass from regular expression compiler
This commit removes the sizing pass for regular expression compilation.
It attempts to be the minimum required to do this. Future patches are
in the works that improve it,, and there is certainly lots more that
could be done.
This is being done now for security reasons, as there have been several
bugs leading to CVEs where the sizing pass computed the size improperly,
and a crafted pattern could allow an attack. This means that simple
bugs can too easily become attack vectors.
This is NOT the AST that people would like, but it should make it easier
to move the code in that direction.
Instead of a sizing pass, as the pattern is parsed, new space is
malloc'd for each regnode found. To minimize the number of such mallocs
that actually go out and request memory, an initial guess is made, based
on the length of the pattern being compiled. The guessed amount is
malloc'd and then immediately released. Hopefully that memory won't be
gobbled up by another process before we actually gain control of it.
The guess is currently simply the number of bytes in the pattern.
Patches and/or suggestions are welcome on improving the guess or this
method.
This commit does not mean, however, that only one pass is done in all
cases. Currently there are several situations that require extra
passes. These are:
a) If the pattern isn't UTF-8, but encounters a construct that
requires it to become UTF-8, the parse is immediately stopped,
the translation is done, and the parse restarted. This is
unchanged from how it worked prior to this commit.
b) If the pattern uses /d rules and it encounters a construct that
requires it to become /u, the parse is immediately stopped and
restarted using /u rules. A future enhancement is to only
restart if something has been encountered that would generate
something different than what has already been generated, as
many operations are the same under both /d and /u. Prior to
this commit, in rare circumstances was the parse immediately
restarted. Only those few that changed the sizing did so.
Instead the sizing pass was allowed to complete and then the
generation pass ran, using /u. Some CVEs were caused by faulty
implementation here.
c) Very large patterns may need to have long jumps in their
program. Prior to this commit, that was determined in the
sizing pass, and all jumps were made long during generation.
Now, the first time the need for a long jump is detected, the
parse is immediately restarted, and all jumps are made long. I
haven't investigated enough to be sure, but it might be
sufficient to just redo the current jump, making it long, and
then switch to using just long jumps, without having to restart
the parse from the beginning.
d) If a reference that could be to capturing parentheses doesn't
find such parentheses, a flag is set. For references that could
be octal constants, they are assumed to be those constants
instead of a capturing group. At the end of the parse, if the
flag indicates either that the assumption(s) were wrong or that
it is a fatal reference to a non-existent group, the pattern is
reparsed knowing the total number of these groups.
e) If (?R) or (?0) are encountered, the flag listed in item d)
above is set to force a reparse. I did have code in place that
avoided doing the reparse, but I wasn't confident enough that
our test suite exercises that area of the code enough to have
exposed all the potential interaction bugs, and I think this
construct is used rarely enough to not worry about avoiding the
reparse at this point in the development.
f) If (?|pattern) is encountered, the behavior is the same as in
item e) above. The pattern will end up being reparsed after the
total number of parenthesized groups are known. I decided not
to invest the effort at this time in trying to get this to work
without a reparse.
It might be that if we are continuing the parse to just count
parentheses, and we encounter a construct that normally would restart
the parse immediately, that we could defer that restart. This would cut
down the maximum number of parses required. As of this commit, the
worst case is we find something that requires knowing all the
parentheses; later we have to switch to /u rules and so the parse is
restarted. Still later we have to switch to long jumps, and the parse
is restarted again. Still later we have to upgrade to UTF-8, and the
parse is restarted yet again. Then the parse is completed, and the
final total of parentheses is known, so everything is redone a final
time. Deferring those intermediate restarts would save a bunch of
reparsing.
Prior to this commit, warnings were issued only during the code
generation pass, which didn't get called unless the sizing pass(es)
completed successfully. But now, we don't know if the pass will
succeed, fail, or whether it will have to be restarted. To avoid
outputting the same warning more than once, the position in the parse of
the last warning generated is kept (across parses). The code looks at
that position when it is about to generate a warning. If the parsing
has previously gotten that far, it assumes that the warning has already
been generated, and suppresses it this time. The current state of
parsing is such that I believe this assumption is valid. If the parses
had divergent paths, that assumption could become invalid.
Karl Williamson [Fri, 19 Oct 2018 17:49:01 +0000 (11:49 -0600)]
regcomp.c: Avoid potential NULL ptr dereference
This commit cause the passed in variable to be non-NULL before
dereferencing it, as defensive coding practice. A future commit causes
this to matter.
Karl Williamson [Fri, 19 Oct 2018 17:47:05 +0000 (11:47 -0600)]
regcomp.c: Test that code block exists before cleaning
This is defensive coding progress, to avoid dereferencing a NULL ptr.
Karl Williamson [Fri, 19 Oct 2018 01:58:45 +0000 (19:58 -0600)]
regcomp.c: Extract code into a function
This should have no changes in behavior, and is for a future commit
where this code will be called from a second place.
Karl Williamson [Fri, 19 Oct 2018 01:02:51 +0000 (19:02 -0600)]
regcomp.c: Test for having /u earlier for \p{}
When \p{} or \p{} are encountered during parsing, that indicates that
the pattern should be compiled not under /d, but under /u, as these are
Unicode constructs. This commit moves the test for that to somewhat
earlier. This saves only a little work currently, but in a future
commit it saves a lot more wasted work.
Karl Williamson [Wed, 17 Oct 2018 17:54:49 +0000 (11:54 -0600)]
regcomp.c: Remove variable in favor of struct element
The code has a structure element that means the same thing part way
through a function as a variable. Just use the struct element all the
way through
Karl Williamson [Tue, 16 Oct 2018 18:16:10 +0000 (12:16 -0600)]
regcomp.c: Move fcn call out of loop
The loop in this case is by a goto label, and the function determines if
there are runtime code blocks in the pattern. That doesn't change if we
have to reparse, so the return from the function doesn't change, so we
only have to call it once.
Karl Williamson [Tue, 16 Oct 2018 03:31:13 +0000 (21:31 -0600)]
regcomp.c: Extract code into a function
This is in preparation for a later commit where the code will become
more complex and be called from more than one place.
Karl Williamson [Mon, 15 Oct 2018 03:12:15 +0000 (21:12 -0600)]
regcomp.c: Consolidate checks for warnings fatality
This adds code so that whenever a warning is about to be emitted, it
first checks to see if the warning is fatal, and if so mortalizes the SV
that otherwise would leak.
This partially fixes ticket [perl #133589]. It doesn't help if the
warnings are called through a subroutine outside of regcomp.c
Karl Williamson [Sun, 14 Oct 2018 23:07:57 +0000 (17:07 -0600)]
regcomp.c: Add macro for warnings output
This macro does nothing for now. It is being added in this separate
commit to lessen the number of differences in the future commit that
will need it, so that these don't distract from the main intent of that
commit.
The code is moving away from emitting all warnings in the code
generation pass, to emitting them as soon as encountered. But to avoid
emitting them more than once should the pattern have to be reparsed,
they will not be emitted unless the parse has gotten further this time
than it got earlier. This commit prepares for that.
Karl Williamson [Sun, 14 Oct 2018 22:59:50 +0000 (16:59 -0600)]
regcomp.c: Defer setting the OP variant of a regnode
This is in preparation for a future commit. We have allocated space and
know that the regnode will be some time of ANYOF one. But we don't need
to know which one precisely until later than we had been setting it.
Karl Williamson [Sun, 14 Oct 2018 22:50:59 +0000 (16:50 -0600)]
regcomp.c: Defer setting regnode operand
Don't set this until we know that we are actually going to have a
regnode that requires this operand.
Karl Williamson [Sun, 14 Oct 2018 22:43:06 +0000 (16:43 -0600)]
regcomp.c: Defer setting flags of a regnode
This is in preparation for a future commit where we won't know what the
regnode is until later in the code.
Karl Williamson [Sun, 14 Oct 2018 22:19:27 +0000 (16:19 -0600)]
regcomp.c: Move some declarations
This is in preparation for some blocks to be removed in a future commit,
so the declarations have to be at the top of the enclosing block
Karl Williamson [Sun, 14 Oct 2018 22:10:01 +0000 (16:10 -0600)]
regcomp.c: Add some const's to static fcn
Since it's static, the compiler can figure out these are consts, but
knowing this helped me read the code
Karl Williamson [Sun, 14 Oct 2018 22:02:09 +0000 (16:02 -0600)]
regcomp.c: Use an equivalent 'if' condition
By inspection of the code, I see that this 'if' won't get executed
unless the variable is non-null. The function whose return sets it
will raise an error if it would otherwise return NULL unexpectedly.
Karl Williamson [Sun, 14 Oct 2018 21:56:57 +0000 (15:56 -0600)]
regcomp.c: Reorder 'if' clauses
This is for sake of clarity so that the comment applies to the adjacent
clause.
Karl Williamson [Sun, 14 Oct 2018 21:50:55 +0000 (15:50 -0600)]
regcomp.c: Rmv unnecessary else
The 'if' if executed aborts, so control would never reach here unless
the 'else' would be taken.
Karl Williamson [Sun, 14 Oct 2018 21:12:41 +0000 (15:12 -0600)]
regcomp.c: Use SvREFCNT_inc_NN()
We know this is non-null as it panics a little ways above unless that's
the case.
Karl Williamson [Sun, 14 Oct 2018 20:30:50 +0000 (14:30 -0600)]
regcomp.c: Use an equivalent 'if' condition
By inspection of the code, I see that this 'if' won't get executed
unless the variable is non-null. The function whose return sets it
will raise an error if it would otherwise return NULL unexpectedly.
Karl Williamson [Sun, 14 Oct 2018 19:56:21 +0000 (13:56 -0600)]
regcomp.c: Combine expression into a macro
This expression will change in a future commit, so this isolates that
change
Karl Williamson [Sun, 14 Oct 2018 19:34:47 +0000 (13:34 -0600)]
regcomp.c: Split variable into two
This commit causes there to now be two variables that count the number
of parentheses in a pattern:
a) the current number as the pattern is parsed
b) the total number, not known until the pattern has been completely
parsed
This will prove useful in later commits.
Karl Williamson [Mon, 15 Oct 2018 02:16:03 +0000 (20:16 -0600)]
Consolidate code into a single macro
If we die during the code generation phase, we set the regex SV to be
freed during cleanup.
This consolidates many of those instances into one macro, so that it can
be easily changed. And instead of tieing it to the particular phase, we
clean up whenever that SV actually exists. This requires initializing
it to NULL.
Karl Williamson [Sun, 14 Oct 2018 18:52:07 +0000 (12:52 -0600)]
regcomp.c: Omit warning if error about to be raised
This commit changes the code to skip a warning when it knows an error is
about to happen. Currently this doesn't matter, as the warning would be
emitted only in a later pass, and the error would actually happen first,
so the warning doesn't get output at all. But future commits will
change that, so this commit is in preparation for that.
Karl Williamson [Sun, 14 Oct 2018 18:01:07 +0000 (12:01 -0600)]
regcomp.c: Add ability to not warn during substitute parse
Under certain conditions, regcomp.c will pretend something other than
the input pattern is to be parsed. There is a mechanism to seamlessly
show the original code when that substitute expression contains the
original as a subset. But there are cases where the entire substitute
is constructed by regcomp.c, and has none of the original pattern in
it. Since it is our construction, it should be legal, devoid of
warnings, but if somehow something happened to generate a warning, it
could lead to seg faults, etc.
This commit adds and uses a mechanism to turn off warnings while parsing
these constructs. Should a warning attempt to be output, instead of a
seg fault, a panic error message giving debugging details is output.
Karl Williamson [Sun, 14 Oct 2018 16:55:51 +0000 (10:55 -0600)]
regcomp.c: Generalize conditions to output warnings
Warnings are deferred until the code generation pass. This doesn't
change that, but makes the condition into a mcaro call so that can be
changed in a future commit.
Karl Williamson [Sat, 13 Oct 2018 06:37:45 +0000 (00:37 -0600)]
regcomp.c: Move some more code to earlier
It is better defensive coding to restore as soon as possible, rather
than deferring it.
Karl Williamson [Sat, 13 Oct 2018 06:29:15 +0000 (00:29 -0600)]
regcomp.c: Move some code to earlier
It is better defensive coding to restore as soon as possible, rather
than deferring it.
Karl Williamson [Mon, 8 Oct 2018 14:00:39 +0000 (08:00 -0600)]
regcomp.c: Consolidate 2nd pass for warnings
Warnings have to generally be delayed being output until the 2nd pass,
as the first pass can be restarted multiple times, and so the same
warning could be output multiple times if the restarted code outputs a
warning.
Prior to this commit, there was an assert that the warnings are being
output in the 2nd pass. This commit changes it so that the assert is
turned into an 'if' in common code, and the dispersed 'if's that
formerly were used are removed as much as possible. If that removes an
indented block, this commit also outdents the block contents.
Karl Williamson [Mon, 8 Oct 2018 13:22:47 +0000 (07:22 -0600)]
regcomp.c: Add macro for warning experimental features
This consolidates the code that warns that an experimental feature is
being called into a common macro.
Karl Williamson [Mon, 8 Oct 2018 13:06:52 +0000 (07:06 -0600)]
regcomp.c: Put common code in a macro
This trivial code is extracted into a common macro in preparation for a
future commit when it will become non-trivial, and hence that logic will
only have to occur once.
Karl Williamson [Sun, 7 Oct 2018 14:03:47 +0000 (08:03 -0600)]
regcomp.c: Rename macro and label
These move away from talking about pass 1, in preparation for future
commits.
Karl Williamson [Wed, 17 Oct 2018 17:21:20 +0000 (11:21 -0600)]
regcomp.c: Use another macro consistently
Sometimes the code refers to the union member explicitly, and sometimes
it uses the macro that evaluates to that member. This commit changes to
consistently use the latter.
Karl Williamson [Tue, 18 Sep 2018 00:17:02 +0000 (18:17 -0600)]
regcomp.c: Use name consistently
In the function Perl_re_op_compile(), there is a stack variable 'ri',
and an element of a stack structure rxi, which part way through one is
set to the other, so that at times one is used and other times the other
is used. This commit removes the variable, in favor of the struct
element, making consistent use throughout the function (and since the
struct is passed to its callees, it makes this value available to them
always)
Karl Williamson [Mon, 17 Sep 2018 04:58:23 +0000 (22:58 -0600)]
regcomp.c: Use regnode offsets during parsing
This changes the pattern parsing to use offsets from the first node in
the pattern program, rather than direct addresses of such nodes. This
is in preparation for a later change in which more mallocs will be done
which will change those addresses, whereas the offsets will remain
constant. Once the final program space is allocated, real addresses are
used as currently. This limits the necessary changes to a few
functions. Also, real addresses are used if they are constant across a
function; again this limits the changes.
Doing this introduces a new typedef for clarity 'regnode_offset' which
is not a pointer, but a count. This necessitates changing a bunch of
things to use 0 instead of NULL to indicate an error.
A new boolean is also required to indicate if we are in the first or
second passes of the pattern. And separate heap space is allocated for
scratch during the first pass.
Karl Williamson [Thu, 20 Sep 2018 17:15:00 +0000 (11:15 -0600)]
regcomp.sym: Add lengths for ANYOF nodes
This changes regcomp.sym to generate the correct lengths for ANYOF
nodes, which means they don't have to be special cased in regcomp.c,
leading to simplification
Karl Williamson [Fri, 21 Sep 2018 14:33:31 +0000 (08:33 -0600)]
regcomp.h: Swap struct vs typedef
This struct has two names. I previously left the less descriptive one
as the primary because of back compat issues. But I now realize that
regcomp.h is only used in the core, so it's ok to swap for the better
name to be primary.
Karl Williamson [Fri, 21 Sep 2018 04:24:59 +0000 (22:24 -0600)]
regcomp.c: Generate new regnode for /[[:posix:]]/l
This follows on to the previous commit and generates code to use the new
regnode. This allows some simplifications. The determination of the
regnode is moved later in the function that does this; the code that
backed this out if we guessed wrong is excised.
Karl Williamson [Thu, 20 Sep 2018 16:52:01 +0000 (10:52 -0600)]
regcomp.sym: Add node type ANYOF_POSIXL
This is like ANYOFL, but has runtime matches of /[[:posix:]]/ in it,
which requires extra space. Adding this will allow a future commit to
simplify handling for ANYOF nodes.
Karl Williamson [Fri, 21 Sep 2018 04:23:00 +0000 (22:23 -0600)]
regcomp.h: Add some macros
These are use to allow the bit map of run-time /[[:posix:]]/l classes to
be stored in a variable, and not just in the argument of an ANYOF node.
This will enable the next commit to use such a variable. The current
macros are rewritten to just call the new ones with the proper arguments.
A macro of a different sort is also created to allow one to set the
entire bit field in the node at once.
Karl Williamson [Fri, 21 Sep 2018 04:21:44 +0000 (22:21 -0600)]
regcomp.h: Remove unused macros
I had kept these macros around for backwards compatibility. But now I
realize regcomp.h is only for core use, so no need to retain them.
Karl Williamson [Mon, 17 Sep 2018 04:53:37 +0000 (22:53 -0600)]
regcomp.c: White-space, comment only
Karl Williamson [Thu, 20 Sep 2018 16:23:01 +0000 (10:23 -0600)]
regcomp.h: White-space, comments only
Karl Williamson [Mon, 17 Sep 2018 04:35:48 +0000 (22:35 -0600)]
regcomp.c: Add conversion macros and use them
This adds macros that hide the details in finding the regnode address
from the offset from the beginning of the pattern's program, and vice
versa.
Karl Williamson [Mon, 17 Sep 2018 04:25:27 +0000 (22:25 -0600)]
regcomp.c: Change macro formal parameter name
The parameter is not a node, but an offset into the array of nodes; The
new name is clearer.
Karl Williamson [Mon, 17 Sep 2018 04:20:42 +0000 (22:20 -0600)]
regcomp.c: Use pre-existing macro
This macro expands to the code it replaces. This will make a future
commit easier.
Karl Williamson [Mon, 17 Sep 2018 02:30:33 +0000 (20:30 -0600)]
regcomp.c: Rename macros; reword some panic messages
These macros had the failure code hard-wired into their names. In
preparation for changing that failure code, change the names and
messages into more generic ones.
Karl Williamson [Thu, 20 Sep 2018 15:44:21 +0000 (09:44 -0600)]
regcomp.h: Create FILL_NODE macro and use it
This is a more fundamental operation than the pre-existing
FILL_ADVANCE_NODE, which is changed to use this for the portion that
fills the node but doesn't advance the pointer.
Karl Williamson [Tue, 16 Oct 2018 15:50:55 +0000 (09:50 -0600)]
t/re/reg_mesg.t: Turn off warns for experimental
These tests aren't testing for this, and a future commit will cause
these to otherwise be output.
Karl Williamson [Sun, 14 Oct 2018 19:11:14 +0000 (13:11 -0600)]
t/lib/warnings/regcomp: Turn off warns for experimental
These tests aren't testing for this, and a future commit will cause
these to otherwise be output.
James E Keenan [Thu, 18 Oct 2018 18:07:27 +0000 (14:07 -0400)]
basic.t: Provide descriptions for all unit tests
The better to be able to navigate around the file when debugging.
Tony Cook [Wed, 17 Oct 2018 04:51:16 +0000 (15:51 +1100)]
(perl #125760) add fatal :utf8 tests for recv and send
Their behaviour on :utf8 streams doesn't seem to have been tested
previously.
James E Keenan [Wed, 17 Oct 2018 20:22:43 +0000 (16:22 -0400)]
Use bsd_glob() instead of glob().
Two instances of glob() which run on MSWin32 were overlooked in commit
df8b709bfcaea9932dd434f18393bfcb4e3d5568.
Thanks to Christian Walde for Win32 smoke testing and assistance in diagnosis.
Karl Williamson [Tue, 16 Oct 2018 18:12:32 +0000 (12:12 -0600)]
regcomp.c: Make 'const' 2 parms to re_op_compile
These are unchanged in the function; might as well indicate that.
Karl Williamson [Wed, 17 Oct 2018 18:26:37 +0000 (12:26 -0600)]
regcomp.c: Change name spelling for clarity
There are two structures: REGEXP and regexp, that are subtly different.
This capitalizes the name of references to the first
Karl Williamson [Sat, 15 Sep 2018 14:17:21 +0000 (08:17 -0600)]
regcomp.c: Add #ifdefs for RE_TRACK_PATTERN_OFFSETS
This is supposed to be independent of DEBUGGING, but in fact regcomp.c
would not compile unless both were false or both true
David Mitchell [Wed, 17 Oct 2018 14:10:10 +0000 (15:10 +0100)]
fix 'for reverse @array' bug on AIX
RT #133558
Due to what appears to be a compiler bug on AIX (or perhaps it's
undefined behaviour which happens to work on other platforms), this line
of code in pp_iter():
inc = 1 - (PL_op->op_private & OPpITER_REVERSED);
was setting inc to
4294967295 rather than to the expected -1 (inc was a
64-bit signed long).
Fix it with a couple of judicious (IV) casts (which ought to be a NOOP).
James E Keenan [Wed, 17 Oct 2018 13:00:43 +0000 (09:00 -0400)]
James E Keenan [Sat, 13 Oct 2018 19:48:39 +0000 (15:48 -0400)]
Remove File::Glob::glob() in perl-5.30
For: RT # 133586
James E Keenan [Sat, 13 Oct 2018 02:29:46 +0000 (22:29 -0400)]
Implement fatalization of dump()
Must now be written fully qualified: CORE::dump().
Adapt tests that previously warned, plus adapt one test that incidentally used dump().
For: RT # 133584
James E Keenan [Fri, 12 Oct 2018 15:55:40 +0000 (11:55 -0400)]
Fatalize use of $* and $#
Adapt tests in various files to removal of these variables. Add
t/lib/croak/gv to test fatalizations of $# and $* -- tests therein
adapted from tests formerly in t/lib/warnings/gv.
Per: RT # 133583
Tomasz Konojacki [Sun, 12 Aug 2018 23:56:47 +0000 (01:56 +0200)]
win32: define HAS_BUILTIN_EXPECT on MinGW
According to perlwin32, the oldest officially supported version of
gcc is 3.4.5. This built-in was introduced in 3.0, which means we
don't have to do any version checks.
[perl #133442]
James E Keenan [Sun, 14 Oct 2018 01:13:14 +0000 (21:13 -0400)]
Update example of Dump on hashref.
For: RT # 133499
Per Tony Cook, the behavior changed in
e1a7ec8d453649a65aea34af90c3042a5137191e (March 2013).
Craig A. Berry [Fri, 12 Oct 2018 19:26:09 +0000 (14:26 -0500)]
Fix used only once warning in gmagic.t.
James E Keenan [Fri, 12 Oct 2018 12:04:22 +0000 (08:04 -0400)]
Sync bignum with CPAN version 0.51
Slaven Rezic [Wed, 3 Oct 2018 14:07:32 +0000 (10:07 -0400)]
Accept also ESTALE (fix for RT #133534)
ESTALE may occur in some environments when accessing a
now non-existing directory, e.g. when using NFS or in docker
containers.
Dagfinn Ilmari Mannsåker [Thu, 11 Oct 2018 16:38:50 +0000 (17:38 +0100)]
Remove obsolete mention of a fifth arena type
Pointer table entries used to be allocated from a fifth arena.
That was removed in commit
db93c0c46b34e8b2e37c671b7362d0fa2550f5f7
(in 2010), but that commit neglected to adjust the number of arena
types in the comment.