This is a live mirror of the Perl 5 development currently hosted at
22 months agoFix unitialized warnings in S_pmtrans
Nicolas R [Thu, 5 Nov 2020 16:30:34 +0000 (10:30 -0600)]
Fix unitialized warnings in S_pmtrans

22 months agoperlapi: PL_runops is documented in perlguts
Karl Williamson [Fri, 6 Nov 2020 01:04:06 +0000 (18:04 -0700)]
perlapi: PL_runops is documented in perlguts

22 months agoperlapi: Split section Display and Dump
Karl Williamson [Fri, 6 Nov 2020 00:39:40 +0000 (17:39 -0700)]
perlapi: Split section Display and Dump

into Debugging and Display sections

22 months A hash needs to have no keys to be empty
Karl Williamson [Fri, 6 Nov 2020 15:21:32 +0000 (08:21 -0700)] A hash needs to have no keys to be empty

22 months Specify scn for single-purpose files
Karl Williamson [Wed, 4 Nov 2020 16:37:34 +0000 (09:37 -0700)] Specify scn for single-purpose files

Many of the files in perl are for one thing only, and hence their
embedded documentation will be for that one thing.  By creating a hash
here of them, those files don't have to worry about what section that
documentation goes under, and so it can be completely changed without
affecting them.

22 months agoRevert and fix " Don't recalculate value"
Karl Williamson [Fri, 6 Nov 2020 14:12:28 +0000 (07:12 -0700)]
Revert and fix " Don't recalculate value"

This reverts commit 0213d97dcda976f02ce257031d969e7964ecc545, and fixes
it up.

That commit failed to account for that there were extra components
needed in the calculation

22 months agoperlapi: PERL_ABS takes an argument
Karl Williamson [Fri, 6 Nov 2020 01:20:20 +0000 (18:20 -0700)]
perlapi: PERL_ABS takes an argument

22 months Enhance apidoc_section feature
Karl Williamson [Wed, 4 Nov 2020 13:13:30 +0000 (06:13 -0700)] Enhance apidoc_section feature

This feature allows documentation destined for perlapi or perlintern to
be split into sections of related functions, no matter where the
documentation source is.  Prior to this commit the line had to contain
the exact text of the title of the section.  Now it can be a $variable
name that expands to the title. It still has to be an exact
match for the variable in autodoc, but now, the expanded text can be
changed in autodoc alone, without other files needing to be updated at
the same time.

22 months agoperlapi: Add a link at the beginning to the Undocumenteds
Karl Williamson [Wed, 4 Nov 2020 15:48:51 +0000 (08:48 -0700)]
perlapi: Add a link at the beginning to the Undocumenteds

22 months Rename a few variables for consistency
Karl Williamson [Wed, 4 Nov 2020 14:54:55 +0000 (07:54 -0700)] Rename a few variables for consistency

22 months Extract code into a fcn
Karl Williamson [Wed, 4 Nov 2020 11:51:39 +0000 (04:51 -0700)] Extract code into a fcn

This is in preparation for it to be called from a 2nd place

22 months Don't recalculate value
Karl Williamson [Wed, 4 Nov 2020 11:46:18 +0000 (04:46 -0700)] Don't recalculate value

e4f5ddf407394c177acefd200a338654dccca2e4 moved this calculation, but I
forgot to remove this portion of it.

22 months White-space, comments only
Karl Williamson [Wed, 4 Nov 2020 11:40:53 +0000 (04:40 -0700)] White-space, comments only

22 months agoperlguts: SAVEBOOL takes a bool
Karl Williamson [Fri, 6 Nov 2020 03:39:26 +0000 (20:39 -0700)]
perlguts: SAVEBOOL takes a bool

22 months agoperlinterp: Fix markup
Karl Williamson [Fri, 6 Nov 2020 01:31:24 +0000 (18:31 -0700)]
perlinterp: Fix markup

FOO is allegoric, not literal

22 months agoperlapi: Move some formats to the Formatting scn
Karl Williamson [Wed, 4 Nov 2020 11:33:15 +0000 (04:33 -0700)]
perlapi: Move some formats to the Formatting scn

These were going into wrong ones.

23 months agoFile::Path: synch with CPAN version 2.18
James E Keenan [Thu, 5 Nov 2020 19:47:37 +0000 (14:47 -0500)]
File::Path: synch with CPAN version 2.18

No change in functionality; change in tests only.

23 months agodragonfly BSD sets errno incorrectly for terminal control functions
Tony Cook [Tue, 27 Oct 2020 15:36:46 +0000 (15:36 +0000)]
dragonfly BSD sets errno incorrectly for terminal control functions

23 months agodragonfly doesn't touch ctime as documented, at least on hammer2
Tony Cook [Mon, 26 Oct 2020 16:51:52 +0000 (16:51 +0000)]
dragonfly doesn't touch ctime as documented, at least on hammer2

This is a TODO so we find out if it's fixed

23 months agodocument the issues for the enoent problem on dragonfly
Tony Cook [Mon, 26 Oct 2020 16:50:44 +0000 (16:50 +0000)]
document the issues for the enoent problem on dragonfly

23 months agodragonfly bsd timestamps are only microsecond precision
Tony Cook [Mon, 26 Oct 2020 16:44:59 +0000 (16:44 +0000)]
dragonfly bsd timestamps are only microsecond precision

based on testing

23 months agodragonfly BSD's default filesystem is mounted noatime by default
Tony Cook [Mon, 26 Oct 2020 16:44:14 +0000 (16:44 +0000)]
dragonfly BSD's default filesystem is mounted noatime by default

23 months agoCatch errors earlier in Devel-Peek/t/Peek.t
Nicolas R [Thu, 27 Aug 2020 17:40:51 +0000 (12:40 -0500)]
Catch errors earlier in Devel-Peek/t/Peek.t

When testing Devel-Peek we can run some tests
inside an eval and do not bother to check if it
succeeds or not.

As STDERR is redirected to a file, we do not even
notice the error message when an error occurs.

This commit postpones the redirection of STDERR
and 'die' if the eval quoted string from `do_test` fails.

23 months agoUpdate ExtUtils-MakeMaker to CPAN version 7.52
Chris 'BinGOs' Williams [Wed, 4 Nov 2020 20:34:01 +0000 (20:34 +0000)]
Update ExtUtils-MakeMaker to CPAN version 7.52


7.52    Wed  4 Nov 19:49:43 GMT 2020

    No changes since v7.51_01

7.51_01 Wed  4 Nov 00:01:41 GMT 2020

    Test fixes:
    - prevent MM_Win32::init_tools() warning in core

7.50    Wed 21 Oct 17:33:53 BST 2020

    No changes since v7.49_04

7.49_04 Tue 13 Oct 18:42:05 BST 2020

    Win32 fixes:
    - make can_dep_space check for short path support

    Macosx fixes:
    - Handle XCode 12's implicit adding of Werror=implicit-function-declaration

7.49_03 Fri  9 Oct 21:30:57 BST 2020

    Regression fixes:
    - disable strict when evaling hints files

    Bug fixes:
    - clean up and improve MIN_PERL_VERSION handling

7.49_02 Thu  8 Oct 08:35:05 BST 2020

    Bug fixes:
    - Change wording of MIN_PERL_VERSION format message to clarify

    Doc fixes:
    - Fixed some typos

7.49_01 Tue  6 Oct 18:01:38 BST 2020

    Regression fixes:
    - fix PERL_CORE warnings from ExtUtils::CBuilder

23 months ago\K in lookaround might become permitted in the future
Tony Cook [Mon, 19 Oct 2020 04:57:37 +0000 (15:57 +1100)]
\K in lookaround might become permitted in the future

It was disallowed because:

- it was breaking things (GH #14638)

- at the time, no-one had the tuits and knowledge to select non-buggy
  semantics and implement them.

23 months agosome extra tests as suggested by hvds
Tony Cook [Mon, 19 Oct 2020 04:04:28 +0000 (15:04 +1100)]
some extra tests as suggested by hvds

23 months agodon't croak when the \K follows the lookaround assertion
Tony Cook [Mon, 14 Sep 2020 06:00:28 +0000 (16:00 +1000)]
don't croak when the \K follows the lookaround assertion

this also simplifies the flagging for these assertions, since this
error is now the only thing using in_lookhead and in_lookbehind they
can be combined into a single in_lookaround.

Rather than conditional increment/decrement as we recurse into S_reg
I simply save the value of in_lookaround and restore it before
returning.  Some unsuccessful or restart paths don't do the restore,
but they either result in a croak(), or a restart which reinitialises
in_lookaround anyway.

Also added tests to ensure that all the different zero-width assertions
with content trigger the error.

23 months agorun_multiple_progs: allow the EXPECT to contain only OPTIONS
Tony Cook [Mon, 14 Sep 2020 05:51:05 +0000 (15:51 +1000)]
run_multiple_progs: allow the EXPECT to contain only OPTIONS

23 months agorun_multiple_progs: allow fatal to be turned off too
Tony Cook [Mon, 14 Sep 2020 05:49:40 +0000 (15:49 +1000)]
run_multiple_progs: allow fatal to be turned off too

in some cases we want to group a test that shouldn't croak with the
croak tests, in particular to catch regressions when we've
introduced a croak.

23 months agoBump the version
Scott Baker [Tue, 11 Aug 2020 16:24:18 +0000 (09:24 -0700)]
Bump the version

23 months agoFix a failing test
Scott Baker [Tue, 11 Aug 2020 16:24:13 +0000 (09:24 -0700)]
Fix a failing test

23 months agoFix some tests for Pod2HTML
Scott Baker [Tue, 11 Aug 2020 15:01:41 +0000 (08:01 -0700)]
Fix some tests for Pod2HTML

23 months agoLeave tabstops at 8
Scott Baker [Mon, 3 Aug 2020 23:34:40 +0000 (16:34 -0700)]
Leave tabstops at 8

23 months agoUse Text::Tabs to convert tabs to spaces instead
Scott Baker [Mon, 3 Aug 2020 23:39:00 +0000 (16:39 -0700)]
Use Text::Tabs to convert tabs to spaces instead

23 months agoChange wording on source of code
Scott Baker [Mon, 3 Aug 2020 21:25:00 +0000 (14:25 -0700)]
Change wording on source of code

23 months agoMake pod2html remove whitespace from literal blocks
Scott Baker [Mon, 3 Aug 2020 20:08:33 +0000 (13:08 -0700)]
Make pod2html remove whitespace from literal blocks

This brings pod2html functionality similar to how Metacpan handles

23 months agoav_make: remove unnecessary AvFILLp assignment
Richard Leach [Mon, 2 Nov 2020 22:52:19 +0000 (22:52 +0000)]
av_make: remove unnecessary AvFILLp assignment

av_make sets `AvFILLp(av)= -1;`, but will already have been set by `newAV()`,
via `newSV_type`'s call to `sv_upgrade`.

This PR also includes the minor cosmetic change of swapping in `newAV()`
in place of its expansion, seemingly the only occurrence of that in core.

23 months agoext/POSIX/t/sysconf.t: only unlink the fifo if we have a name for it
Tony Cook [Tue, 3 Nov 2020 22:21:37 +0000 (09:21 +1100)]
ext/POSIX/t/sysconf.t: only unlink the fifo if we have a name for it

This warned on Win32 since the whole test file is skipped due
to the lack of anything sysconf() to test.

23 months agoext/POSIX/t/posix.t: 0ee0b3d1 added 'use warnings', fix the warnings
Tony Cook [Tue, 3 Nov 2020 22:10:43 +0000 (09:10 +1100)]
ext/POSIX/t/posix.t: 0ee0b3d1 added 'use warnings', fix the warnings

locales_enabled() accepts either an optional category name, or an
arrayref of category names, and is prototyped to accept a scalar, so
the qw() was evaluated in scalar context, ignoring the "NUMERIC" and
producing a warning.

The POSIX::pipe() test is testing the POSIX::pipe() function, not
globs, so just use lexical handles.

These warnings came up while cleaning up noise in the Win32 build, but
the warnings occur on Linux too.

Useless use of a constant ("NUMERIC") in void context at t/posix.t line 358.
Name "main::WRITER" used only once: possible typo at t/posix.t line 78.
Name "main::READER" used only once: possible typo at t/posix.t line 77.

23 months agorun/locale.t: don't setlocale() for our English locale if there isn't one
Tony Cook [Tue, 3 Nov 2020 04:37:33 +0000 (15:37 +1100)]
run/locale.t: don't setlocale() for our English locale if there isn't one

This was producing noise on Win32 builds:

Use of uninitialized value in subroutine entry at run/locale.t line 519.

23 months agoadd versions to POSIX features
Dan Book [Fri, 11 Aug 2017 19:37:14 +0000 (15:37 -0400)]
add versions to POSIX features

23 months agoperldata - example of using DATA
Dan Book [Tue, 3 Nov 2020 06:54:22 +0000 (01:54 -0500)]
perldata - example of using DATA

23 months agoallow watchdog() to work in taint mode on non-threaded Win32
Tony Cook [Tue, 3 Nov 2020 04:11:30 +0000 (15:11 +1100)]
allow watchdog() to work in taint mode on non-threaded Win32

This was producing noise:

Insecure $ENV{PATH} while running with -T switch at ./ line 1673.

from perf/taint.t and re/substT.t

23 months agoNote various symbols are documented in perlinterp
Karl Williamson [Sat, 17 Oct 2020 17:28:56 +0000 (11:28 -0600)]
Note various symbols are documented in perlinterp

23 months agoCertain PERL_UNICODE symbols are core only
Karl Williamson [Sat, 17 Oct 2020 21:58:01 +0000 (15:58 -0600)]
Certain PERL_UNICODE symbols are core only

23 months agoNote MRO_GET_PRIVATE_DATA is documented in perlmroapi
Karl Williamson [Sat, 17 Oct 2020 17:30:29 +0000 (11:30 -0600)]
Note MRO_GET_PRIVATE_DATA is documented in perlmroapi

23 months agoNote various symbols are documented in perliol
Karl Williamson [Sat, 17 Oct 2020 17:29:40 +0000 (11:29 -0600)]
Note various symbols are documented in perliol

23 months agodon't read DATA when it is closed
Tony Cook [Tue, 3 Nov 2020 03:03:32 +0000 (14:03 +1100)]
don't read DATA when it is closed

This has been producing noise for a while, but some recent change
meant it started some warning tests failing.

23 months agoexport delimcpy_no_escape() so XS::APItest can use it
Tony Cook [Mon, 2 Nov 2020 23:23:34 +0000 (10:23 +1100)]
export delimcpy_no_escape() so XS::APItest can use it

23 months agoperlapi: Fix signature for PadnameOURSTASH
Karl Williamson [Sat, 17 Oct 2020 15:22:23 +0000 (09:22 -0600)]
perlapi: Fix signature for PadnameOURSTASH

This takes a parameter

23 months agoregcomp.h: Restrict scope of symbols to core
Karl Williamson [Sat, 17 Oct 2020 15:12:59 +0000 (09:12 -0600)]
regcomp.h: Restrict scope of symbols to core

Everything defined here are internal symbols

23 months agouni_keywords.h: Confine the scope to core
Karl Williamson [Sat, 17 Oct 2020 13:36:32 +0000 (07:36 -0600)]
uni_keywords.h: Confine the scope to core

All symbols in here are for core only use

23 months agoConfine regnodes.h symbols to core
Karl Williamson [Sat, 17 Oct 2020 13:23:40 +0000 (07:23 -0600)]
Confine regnodes.h symbols to core

This is to not pollute XS namespace, and to not autodoc them.

23 months agoperlapi: WIDEST_UTYPE is a typedef
Karl Williamson [Sat, 17 Oct 2020 12:51:04 +0000 (06:51 -0600)]
perlapi: WIDEST_UTYPE is a typedef

23 months agoperlapi: StructCopy isn't conventional
Karl Williamson [Sat, 17 Oct 2020 12:49:24 +0000 (06:49 -0600)]
perlapi: StructCopy isn't conventional

so suppress the usage line.

23 months agohv_func.h, hv_macro.h: Rename compile-once guard
Karl Williamson [Sat, 17 Oct 2020 12:47:11 +0000 (06:47 -0600)]
hv_func.h, hv_macro.h: Rename compile-once guard

These #defines are internal-only, so mark them as such by adding a
trailing underscore to their names.

23 months agoCast parameters to instr, strstr
Karl Williamson [Sat, 17 Oct 2020 12:00:22 +0000 (06:00 -0600)]
Cast parameters to instr, strstr

This code isn't apparently compiled on modern platforms, as when I tried
to force them to compile, I had to do this.

23 months agointrpvar.h: Don't define an undef symbol
Karl Williamson [Mon, 2 Nov 2020 04:02:03 +0000 (21:02 -0700)]
intrpvar.h: Don't define an undef symbol

This symbol needs MULTIPLICTY for its target to actually be defined.
Discovered by Devel::PPPort

23 months agoXSUB.h: Fix some apidoc entries
Karl Williamson [Mon, 2 Nov 2020 03:58:42 +0000 (20:58 -0700)]
XSUB.h: Fix some apidoc entries

So that Devel::PPPort can test that they compile

23 months agoperlapi: Add a link to xsubpp
Karl Williamson [Mon, 2 Nov 2020 03:57:55 +0000 (20:57 -0700)]
perlapi: Add a link to xsubpp

23 months agoperlguts: Fix up some perlapi entries
Karl Williamson [Mon, 2 Nov 2020 03:32:56 +0000 (20:32 -0700)]
perlguts: Fix up some perlapi entries

There were syntax errors in these.

23 months agoperlapi: Document IV_MAX, UV_MAX
Karl Williamson [Sat, 17 Oct 2020 21:37:18 +0000 (15:37 -0600)]
perlapi: Document IV_MAX, UV_MAX

23 months agoperlclib: Don't mention toFOO_LC()
Karl Williamson [Sat, 31 Oct 2020 18:32:41 +0000 (12:32 -0600)]
perlclib: Don't mention toFOO_LC()

There are locales where these macros don't give the right answer for all
legal inputs; so don't mention them.

23 months agoperlio.c: White-space, dead-code only
Karl Williamson [Sat, 31 Oct 2020 18:29:08 +0000 (12:29 -0600)]
perlio.c: White-space, dead-code only

This properly indents nested #preprocessor directives, and removes two
empty #if's

23 months agoBen Cornett is now a Perl author
James E Keenan [Sun, 1 Nov 2020 02:35:52 +0000 (22:35 -0400)]
Ben Cornett is now a Perl author

23 months agoFix typo in perlguts 18277/head
Ben Cornett [Sun, 1 Nov 2020 02:20:05 +0000 (22:20 -0400)]
Fix typo in perlguts

23 months agoperlapi: Document SvPV_free
Karl Williamson [Thu, 8 Oct 2020 20:14:46 +0000 (14:14 -0600)]
perlapi: Document SvPV_free

23 months agoFix up delimcpy_no_escape()
Karl Williamson [Sat, 17 Oct 2020 03:08:13 +0000 (21:08 -0600)]
Fix up delimcpy_no_escape()

I modified this function in ab01742544b98b5b5e13d8e1a6e9df474b9e3005,
and did not fully understand the edge cases.  This commit now handles
those properly, the same as plain delimcpy() does.

23 months agoRewrite delimcpy to use memchr and Copy, not per-byte
Karl Williamson [Fri, 16 Oct 2020 19:27:55 +0000 (13:27 -0600)]
Rewrite delimcpy to use memchr and Copy, not per-byte

Prior to this commit delimcpy() parsed its input byte-by-byte, looking
for a particular character, and copied the input to the output stopping
just before the first such occurrence.

memchr() is much faster for finding a single character.

The complication is that if the character is preceded by a backslash,
it doesn't count as that character, it is considered to be escaped, and
parsing continues to the first unescaped occurrence, if any. Each
escaping backslash is not copied.

The prior code also failed to account for the possibility of the delimiter
being a backslash, the same as the escape.

The new routine looks for the character with memchr, sees if it is
escaped. If not, Copy does the whole copy at once. If it is escaped,
it uses Copy up to that backslash, and repeats the process.

23 months agoAdd API test for delimcpy()
Karl Williamson [Sun, 16 Aug 2020 12:50:12 +0000 (06:50 -0600)]
Add API test for delimcpy()

It turns out that the existing implementation has some bugs, so some of
the tests are marked TODO.

23 months agoPerl_custom_op_get_field(): remove undef behaviour
David Mitchell [Fri, 30 Oct 2020 20:50:58 +0000 (20:50 +0000)]
Perl_custom_op_get_field(): remove undef behaviour

Thus function has a couple a switches with

                   NOT_REACHED; /* NOTREACHED */

but clang is complaining that the value returned by the function is
undefined if those default branches are taken, since the 'any' variable
doesn't get set in that path.

Replace the NOTREACHED with a croak("panic: ..."). It's possible (albeit
not intended) for Perl_custom_op_get_field() to be called with a 'field'
arg which triggers the default case. So if this ever happens, make it
clear that something has gone wrong, rather than just silently
continuing on non-debugging builds.

In any case, this shuts up clang.

23 months agoPathTools/Cwd.xs: fix off-by-one in bsd_realpath()
David Mitchell [Mon, 26 Oct 2020 15:11:14 +0000 (15:11 +0000)]
PathTools/Cwd.xs: fix off-by-one in bsd_realpath()

At the heart of this function is a loop which repeatedly finds the next
component in the path, processes it, then chops that component off the
front of the path by shifting the string to the start of the buffer;
i.e. something like:

    while (remaining_len) {
        s = strchr(remaining, '/')
        remaining_len -= s - remaining;
        memmove(remaining, s, remaining_len + 1);

The problem is that the per-iteration decrement to remaining_len doesn't
take account of the '/' character, so each iteration, remaining_len gets
one more byte too big.

It turns out that this is harmless - it just means that more and more
garbage characters after the trailing null byte get copied each time,
but after each copy the path string is still well formed, with a
trailing null in the right place. So just the random garbage after the
null byte is different.

This commit fixes that.

Although really, it would be better to just increment the
start-of-string pointer each time rather than shift the whole string
each time.

23 months agobump version numbers for PathTools to 3.79
David Mitchell [Mon, 26 Oct 2020 15:13:29 +0000 (15:13 +0000)]
bump version numbers for PathTools to 3.79

23 months agoext/POSIX/t/posix.t: use 'warnings'
Karl Williamson [Thu, 29 Oct 2020 20:18:19 +0000 (14:18 -0600)]
ext/POSIX/t/posix.t: use 'warnings'

23 months agot/run/locale.t: use 'warnings'
Karl Williamson [Thu, 29 Oct 2020 20:16:51 +0000 (14:16 -0600)]
t/run/locale.t: use 'warnings'

A symobl it was testing is either defined or not; was testing the wrong

23 months use 'warnings'
Karl Williamson [Thu, 29 Oct 2020 22:09:15 +0000 (16:09 -0600)] use 'warnings'

23 months Fix locales_enabled()
Karl Williamson [Thu, 29 Oct 2020 21:53:50 +0000 (15:53 -0600)] Fix locales_enabled()

This commit properly returns the new list it is supposed to, clarifies
the documentation.

Fixes GH #18245

23 months agot/ Don't destroy caller's array
Karl Williamson [Thu, 29 Oct 2020 20:30:46 +0000 (14:30 -0600)]
t/ Don't destroy caller's array

This changes to make a copy of the input array, which can then be
modified without affecting the caller.

23 months agoremove assertion that collation magic has data
Tony Cook [Thu, 29 Oct 2020 04:59:16 +0000 (15:59 +1100)]
remove assertion that collation magic has data

This broke on some smokers where the locale collation data was
broken in some way (and rejected by the collation setup code.)

It also broke if collation magic was generated for an SV and then
the SV was modified, freeing the collation data before the SV was

23 months agoremove dead code when using Perl_strtod for numeric conversion
Tony Cook [Wed, 21 Oct 2020 00:02:20 +0000 (11:02 +1100)]
remove dead code when using Perl_strtod for numeric conversion

which is the common case.

If strtod() is disabled, (and USE_PERL_ATOF isn't also disabled) this
code is used, so I moved it into the #elif block.

It's also possible to Configure disabling both strtod() and

  ./Configure ... -Ud_strtod -Accflags=-DUSE_PERL_ATOF=0 ...

which resulted in a build with a broken Perl_my_atof3(), so fail the
build early with #error in that case.

23 months agoembed.h: Add caution about PERL_NO_SHORT_NAMES
Karl Williamson [Mon, 19 Oct 2020 21:49:27 +0000 (15:49 -0600)]
embed.h: Add caution about PERL_NO_SHORT_NAMES

23 months agoFix GH #17278
Karl Williamson [Fri, 23 Oct 2020 13:54:53 +0000 (07:54 -0600)]
Fix GH #17278

This was an assertion failure in regexec.c under rare circumstances.  A
reduction of the fuzzed test case is now in pat_advanced.t

The root cause of this was that the pattern being compiled was encoded in
UTF-8 and 'use locale' was in effect, equivalent to the /l charset, and
then the charset was reset inside the pattern, to /d.  But /d in a UTF-8
patterns is illegal, hence the later assertion failure.

The solution is to reset instead to /u when the pattern is UTF-8.

23 months ago[MERGE] don't do special-cases in S_mg_free_struct
David Mitchell [Fri, 23 Oct 2020 13:26:11 +0000 (14:26 +0100)]
[MERGE] don't do special-cases in S_mg_free_struct

Move all the special-case handling of various magic types out into
vtable->free() methods.

23 months agoadd Perl_magic_freemglob() magic vtable method
David Mitchell [Mon, 19 Oct 2020 15:01:49 +0000 (16:01 +0100)]
add Perl_magic_freemglob() magic vtable method

S_mg_free_struct() has a workaround to never free mg->mg_ptr for

Move this logic into a new magic vtable free method instead, so that
S_mg_free_struct() (which gets called for every type of magic) doesn't
have the overhead of checking every time for mg->mg_type ==

[ No, I don't know why PERL_MAGIC_regex_global's vtable and methods
  are suffixed mglob rather than regex_global or vice versa ]

23 months agoadd Perl_magic_freeutf8() magic vtable method
David Mitchell [Mon, 19 Oct 2020 13:54:59 +0000 (14:54 +0100)]
add Perl_magic_freeutf8() magic vtable method

S_mg_free_struct() has a workaround to free mg->mg_ptr in
PERL_MAGIC_utf8 even if mg_len is zero.

Move this logic into a new magic vtable free method instead, so that
S_mg_free_struct() (which gets called for every type of magic) doesn't
have the overhead of checking every time for mg->mg_type ==

23 months agoadd Perl_magic_freecollxfrm() magic vtable method
David Mitchell [Mon, 19 Oct 2020 13:43:18 +0000 (14:43 +0100)]
add Perl_magic_freecollxfrm() magic vtable method

v5.29.9-139-g44955e7de8 added a workaround to S_mg_free_struct() to
free mg->mg_ptr in PERL_MAGIC_collxfrm even if mg_len is zero.

Move this logic into a new magic vtable free method instead, so that
S_mg_free_struct() (which gets called for every type of magic) doesn't
have the overhead of checking every time for mg->mg_type ==

23 months agot/ Consider thread 0 always locale-safe
Karl Williamson [Wed, 21 Oct 2020 10:46:51 +0000 (04:46 -0600)]
t/ Consider thread 0 always locale-safe

Test files call this code to see if locales are enabled.  Prior to this
commit, it returned that they were disabled on builds where there are
possible races between threads.  This was to silence some rarely
occurring smoke failures.  But that had the result that such builds
didn't get locales tested at all, even if there was just a single thread
operating.  This commit changes it so that when called from other than
the main thread on such a system, it returns disabled, but enabled for
the main thread.

23 months agoperlguts: some items are actually documented in config.h
Karl Williamson [Sat, 17 Oct 2020 18:14:34 +0000 (12:14 -0600)]
perlguts: some items are actually documented in config.h

23 months agoautodoc: Add clarifying info to error messages
Karl Williamson [Wed, 21 Oct 2020 00:56:00 +0000 (18:56 -0600)]
autodoc: Add clarifying info to error messages

23 months agoperl.h: Fix rarely compiled syntax errors
Karl Williamson [Sat, 17 Oct 2020 21:52:12 +0000 (15:52 -0600)]
perl.h: Fix rarely compiled syntax errors

This #ifdef'd code clearly doesn't get compiled, as it would fail.

23 months agoperl.h: Fix typo in comment
Karl Williamson [Sat, 17 Oct 2020 21:38:17 +0000 (15:38 -0600)]
perl.h: Fix typo in comment

23 months agoperl.h: Call macro instead of expanding it out
Karl Williamson [Sat, 17 Oct 2020 21:35:32 +0000 (15:35 -0600)]
perl.h: Call macro instead of expanding it out

23 months agoperlapi: Add markup
Karl Williamson [Sat, 17 Oct 2020 18:49:34 +0000 (12:49 -0600)]
perlapi: Add markup

23 months agoutf8.c: Add blank line for visual clarity
Karl Williamson [Sat, 17 Oct 2020 18:48:13 +0000 (12:48 -0600)]
utf8.c: Add blank line for visual clarity

23 months agoperlapi: PTRV is a typedef
Karl Williamson [Sat, 17 Oct 2020 18:45:33 +0000 (12:45 -0600)]
perlapi: PTRV is a typedef

23 months Use $scalars to hold heading names
Karl Williamson [Tue, 20 Oct 2020 18:03:13 +0000 (12:03 -0600)] Use $scalars to hold heading names

Prior to this, the headings were kept as string keys in a hash.  This
allows for easier tweaking of their contents, and to more easily catch

23 months Output undocumented fcns in multi columns
Karl Williamson [Tue, 20 Oct 2020 15:44:04 +0000 (09:44 -0600)] Output undocumented fcns in multi columns

This is just a list, with nothing to be gained by having a single entry
per line, and making multiple columns shortens it significantly.

23 months Extract code into a function
Karl Williamson [Tue, 20 Oct 2020 13:31:03 +0000 (07:31 -0600)] Extract code into a function

This is in preparation of it becoming more complex in a future commit

23 months Rename sort function for clarity of purpose
Karl Williamson [Tue, 20 Oct 2020 13:43:36 +0000 (07:43 -0600)] Rename sort function for clarity of purpose

23 months agoDevel::PPPort Makefile.PL is not customized since 46677718f1
Steve Hay [Thu, 22 Oct 2020 07:07:19 +0000 (08:07 +0100)]
Devel::PPPort Makefile.PL is not customized since 46677718f1