This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Shlomi Fish [Wed, 22 May 2019 10:27:32 +0000 (13:27 +0300)]
Correct some grammar in README.linux and update it
Fix GH #17007
(cherry picked from commit
b9677ee9a1dd1f5d79c5ab3e2e788eea65c20253)
Signed-off-by: Nicolas R <atoomic@cpan.org>
Nicolas R [Wed, 11 Mar 2020 20:01:44 +0000 (14:01 -0600)]
lib/unicore/mktables: use function signatures
Also regenerate files depending on lib/unicore/mktables
./perl -Ilib regen/mk_invlists.pl; ./perl -Ilib regen/regcharclass.pl
Nicolas R [Wed, 11 Mar 2020 17:23:52 +0000 (11:23 -0600)]
modernize mkppport with signatures
Karl Williamson [Thu, 19 Mar 2020 00:35:08 +0000 (18:35 -0600)]
regen/reentr.pl: Add comment
Karl Williamson [Sun, 15 Mar 2020 20:14:34 +0000 (14:14 -0600)]
regen/reentr.pl: Rearrange ternary expression
I and Perl Best Practices agree that this syntax is hard to read.
Karl Williamson [Sat, 7 Mar 2020 20:01:39 +0000 (13:01 -0700)]
File-Glob/bsd_glob.c: use PerlEnv_getenv()
which has added protections beyond plain getenv()
Karl Williamson [Mon, 16 Mar 2020 04:17:32 +0000 (22:17 -0600)]
Perl_init_tm: Use mutex to avoid race.
This locks around localtime (and localtime_r which this call may be
translated into) which are sensitive to locale and environment changes
in their execution.
Karl Williamson [Thu, 19 Mar 2020 00:09:24 +0000 (18:09 -0600)]
Merge branch 'time64' into blead
This branch refactors a portion of time64.c, simplifying and protecting
against races on threaded perls.
Karl Williamson [Mon, 16 Mar 2020 13:42:58 +0000 (07:42 -0600)]
time64.c: Add a branch prediction for unlikely event
Karl Williamson [Sun, 15 Mar 2020 18:16:47 +0000 (12:16 -0600)]
time64.c: Add mutex protection
The gmtime_r() and localtime_r() functions are not thread safe with
regards to changes in the environment and locale while executing. This
protects them with a mutex, but only from other functions that also
participate in using that mutex. Future commits will change everything
in the perl core to do that, but there is still a hole if some XS
writer, or alien library doesn't use the mutex.
Karl Williamson [Sun, 15 Mar 2020 16:19:18 +0000 (10:19 -0600)]
time64.[ch]: Inline only use of another macro
This macro is now only used once. It is accessible outside perl because
it is in time64.h, but isn't used in cpan. Remove it and place its
expansion in time64.c.
Part of the expansion called another function. That function can be
removed and the expansion simplified, since gmtime() is now
automatically converted into gmtime_r() if available and needed.
Karl Williamson [Sun, 15 Mar 2020 04:34:00 +0000 (22:34 -0600)]
time64.[ch]: Inline only use of a macro and fcn
This macro is now only used once, and was the only caller of a helper
function. Thus both can be removed and inlined, simplifying things.
Further, most of the function's functionality can be removed, since it
was an attempt to simulate localtime_r(), which is now automatically
furnished by reentrant.[ch] if needed.
Karl Williamson [Sun, 15 Mar 2020 15:36:29 +0000 (09:36 -0600)]
time64.c: White-space only
Indent code blocks created by the previous commit; a few more
white-space adjustments.
Karl Williamson [Sat, 14 Mar 2020 20:33:05 +0000 (14:33 -0600)]
time64.c: Refactor Perl_localtime64_r()
There are two main cases in Perl_localtime64_r(), call them A and B.
Prior to this commit, it was structured
if (A) {
codeA
return;
}
codeB
return;
The problem this commit solves is that there is common stuff in codeA
and codeB that will now only be specified once. Currently that common
stuff is minimal, and so acceptable, but the next few commits will make
the common stuff more complex, so making it be only once is helpful.
Karl Williamson [Sat, 14 Mar 2020 20:18:56 +0000 (14:18 -0600)]
time64.c: Store fcn return in a variable
This is in preparation for it being used in more than one place
Karl Williamson [Sun, 15 Mar 2020 20:18:53 +0000 (14:18 -0600)]
reentr.[ch]: Add gmtime_r, localtime_r
This now replaces occurrences of the non re-entrant versions of these
two functions with the reentrant ones.
Karl Williamson [Mon, 16 Mar 2020 18:00:51 +0000 (12:00 -0600)]
reentr.h: Add way to see if reentrant used
The reentrant mechanism automatically and silently replaces a given
function by its reentrant version when warranted. Until now, there was
no direct way to test if it actually happens. One could infer it,
possibly, but not without the potential for getting it wrong.
Now, for function foo, add #ifdef PERL_REENTR_USING_FOO_R
Karl Williamson [Mon, 16 Mar 2020 17:52:59 +0000 (11:52 -0600)]
reentr.h: Add clarifying comment
Karl Williamson [Mon, 16 Mar 2020 17:13:40 +0000 (11:13 -0600)]
reentr.[ch]: White-space only
This is a follow-on to
7c1815b7942f8c7e3651d98060ca7a0760e6483c,
that adds some more white space indentation fixes
Karl Williamson [Mon, 16 Mar 2020 03:33:19 +0000 (21:33 -0600)]
perl.h: Add ENV_LOCALE (UN)?LOCK macros
These are eventually intended to lock both the environment and locale
mutexes, but it is too late in the current development cycle to do that.
Instead these are, for now, equivalent to a plain ENV mutex.
(On many modern platforms, the locale mutex is a no-op, so not doing it
is not actually a problem.)
In the meantime, this gives significant better thread safety than what
has been in effect.
Karl Williamson [Thu, 5 Mar 2020 03:58:28 +0000 (20:58 -0700)]
pp_match(): output regex debugging info
This fixes #17612
This adds an inline function to pp_hot to be called to determine if
debugging info should be output or not, regardless of whether it comes
from -Dr, or from a 'use re Debug' statement
Karl Williamson [Thu, 5 Mar 2020 03:52:57 +0000 (20:52 -0700)]
regcomp.h: Add macro
This macro is for files outside of regcomp.c/regexec.c (and
re_comp.c/re_exec.c) to have access to the re.pm Debug options.
Right now pp_match could benefit from this.
Karl Williamson [Thu, 5 Mar 2020 03:13:27 +0000 (20:13 -0700)]
pp_match: Use 'z' length modifier to format sizes
This makes things easier to read.
Karl Williamson [Tue, 17 Mar 2020 17:39:02 +0000 (11:39 -0600)]
POSIX.xs: Never pass NULL to ctermid()
Doing so can cause races.
It is interesting that POSIX:ctermid() takes a parameter, but the
pod doesn't indicate that it does. Prior to this commit the parameter
was ignored if and only if the platform contains a ctermid_r()
function, and hence on such platforms there was no possibility of a race
here. The man pages I've seen for ctermid_r() indicate that it differs
from regular ctermid() only in that it will fail if the input is NULL,
and hence a race could occur if it didn't immediately fail.
The situation prior to this commit wa that if you followed the pod on a
non-ctermid_r() platform, and called this without a parameter, it would
call ctermid with NULL, creating a potential race. This commit changes
so that a race is never possible.
Karl Williamson [Wed, 18 Mar 2020 20:53:05 +0000 (14:53 -0600)]
Regne reentr.c.
Commit
727613455d53416b197154b7b3cad20fe26372bb failed to regenerate
reentr.c after changes.
Karl Williamson [Wed, 11 Mar 2020 20:35:44 +0000 (14:35 -0600)]
reentr.c: revise handling of several wrapped fcns
Prior to this commit, the code in this function had generic variables,
like p0, and malloc'd them using void *, and then cast to what it
thought were the proper types. This was failing on solaris g++, because
of the stricter casting rules in C++.
This commit actually simplifies the code, by getting rid of the generic
stuff, and for each group of related functions, declares the appropriate
names for the variables, and mallocs them using the correct type as
expressed in the __DATA__ section of regen/reentr.pl. The casting is
eliminated, except for one case for gethostbyaddr(). Tony Cook pointed
out that the 2001 POSIX standard used a type name for this that may be
shorter than Size_t. This could be a potential issue, but not on the
platforms tested as of now.
And this fixes #17482, so works where the previous didn't.
Karl Williamson [Wed, 11 Mar 2020 18:24:33 +0000 (12:24 -0600)]
reentr.c: Handle getspnam()
This has never worked to increase the buffer size if necessary.
Apparently the default has always been big enough. But this commit
fixes it to retry if too small.
I don't think there is a way to write tests for this. getspnam is
called only as a small part of pp_gpwent, and is not part of the API,
and is called only when run as root.
I did test it on my box, with gdb, starting with a buffer size of 1, and
single stepping and observing that it works as I expected.
Karl Williamson [Wed, 11 Mar 2020 18:05:01 +0000 (12:05 -0600)]
reentr.c: Use keywords, not ops
The parameter to this function is a string containing the name of the
wrapped function. Prior to this commit, it was assumed, without
checking, that PL_op->op_type corresponded to this name. This
assumption can't be always correct because at least one of the wrapped
functions doesn't have an op, getspnam. That means it never would have
worked for that function to increase its buffer size. When I was
examining this some years ago (and didn't follow up until now), ISTR
that there were other cases where the correspondence was wrong, but I
couldn't reproduce that now.
There is no easy conversion from string to OP code, but there is from
string to keyword number. This commit changes to use that conversion
function, and switches based on the keyword number. A later commit
fixes getspnam.
David Mitchell [Thu, 12 Mar 2020 14:14:24 +0000 (14:14 +0000)]
fixup to "avoid identical stack traces" - try 2
GH #15109, #17567
[ this commit was originally applied as v5.31.9-121-gfb8188b84d, but was
quickly reverted by v5.31.9-124-g6311900a66. I'm now -re-applying it,
but with a 'SAVEFREEOP(PL_curcop)' added, which was missing from the
original commit. ]
My original fix for this issue, v5.31.6-141-gf2f32cd638
made a shallow copy of &PL_compiling. However, for non-default
warning bits, this made two COPs share the malloced() cop_warnings,
and bad things ensured. In particular this was flagged up in:
GH #17567: "BBC: AYOUNG/OpenVZ-0.01.tar.gz"
The fix in this commit is to do a deep copy of the COP using
newSTATEOP().
Karl Williamson [Tue, 17 Mar 2020 03:13:39 +0000 (21:13 -0600)]
Karl Williamson [Mon, 16 Mar 2020 20:27:49 +0000 (14:27 -0600)]
perlre: Note savepv() allocations need to be freed
Dagfinn Ilmari Mannsåker [Mon, 16 Mar 2020 19:40:00 +0000 (19:40 +0000)]
switch_category_locale_to_template: Fix use-after-free under -DLv
Coverity CID 288709
Karl Williamson [Sat, 7 Mar 2020 19:42:23 +0000 (12:42 -0700)]
Dynaloader: Add, fix comments
Karl Williamson [Sun, 8 Mar 2020 00:02:37 +0000 (17:02 -0700)]
iperlsys.h: White-space only
Nicolas R [Tue, 10 Mar 2020 17:14:04 +0000 (11:14 -0600)]
Add macro to free and set cop_warnings
This is avoiding the boilerplate to free
the cop_warning string when setting it.
Karl Williamson [Wed, 11 Mar 2020 17:33:39 +0000 (11:33 -0600)]
reentr.[ch]: White-space only
I changed the preprocessor directive indentation to make it easier to
grasp the nesting levels, and added blank lines for readability.
Some of the changes are for future commits that will remove some
nesting.
Karl Williamson [Tue, 10 Mar 2020 23:16:23 +0000 (17:16 -0600)]
regen/reentr.pl: Add some comments
Dave Rolsky [Sat, 14 Mar 2020 17:59:09 +0000 (12:59 -0500)]
Fix language referring to GitHub issue tracker in various places
There were a number of spots that used language more appropriate for an email
address than a web-based tracker.
I noticed this because of the recent 5.30.2 release, which has a perldelta
containing the sentence "If you find any we have missed, send email to
https://github.com/Perl/perl5/issues."
But I think that was because the 5.30.2 branch did not include
8166b4e0bc220e759aa233af54ac1e60cc510f0c.
Steve Hay [Sat, 14 Mar 2020 17:59:21 +0000 (17:59 +0000)]
Fill in link for 5.30.2 epigraph
Steve Hay [Sat, 14 Mar 2020 17:49:42 +0000 (17:49 +0000)]
Import perl5302delta.pod
Steve Hay [Sat, 14 Mar 2020 17:42:23 +0000 (17:42 +0000)]
Module::CoreList - Add entry for forthcoming 5.31.10 to Changes
This got missed by
4b9ba9feb3.
Steve Hay [Sat, 14 Mar 2020 17:40:14 +0000 (17:40 +0000)]
Module::CoreList - Fix date of 5.30.2
This got missed by
30107e92e6 on the maint-5.30 branch.
Steve Hay [Sat, 14 Mar 2020 17:36:26 +0000 (17:36 +0000)]
Update Module-CoreList with data for 5.30.2
Steve Hay [Sat, 14 Mar 2020 17:17:28 +0000 (17:17 +0000)]
Tick off 5.30.2
Steve Hay [Sat, 14 Mar 2020 17:16:13 +0000 (17:16 +0000)]
Add epigraph for 5.30.2
Steve Hay [Sat, 14 Mar 2020 12:25:24 +0000 (12:25 +0000)]
5.30.2 today
Dan Book [Sat, 14 Mar 2020 00:19:20 +0000 (20:19 -0400)]
perlop - Avoid $a and $b
Nicolas R [Fri, 13 Mar 2020 21:41:14 +0000 (15:41 -0600)]
Fetch git history to run tests like t/porting/cmp-version.t
Make sure t/porting/cmp-version.t is run by GitHub workflow
in order to catch issues on Pull Requests.
Setup a larg diff.renameLimit to avoid git warnings from
multiple unit tests.
Note: the i386 workflow cannot use checkout@v2 and need to keep
using checkout@v1.
Nicolas R [Fri, 13 Mar 2020 18:00:11 +0000 (12:00 -0600)]
Bump IPC-Open3 versions to fix cmp_version.t
Peter Oliver [Sat, 7 Mar 2020 19:47:09 +0000 (19:47 +0000)]
Explain that a shell isn’t always used with qx/STRING/.
Peter Oliver [Wed, 5 Feb 2020 18:34:12 +0000 (18:34 +0000)]
Silence test failure by updating AUTHORS.
Peter Oliver [Fri, 31 Jan 2020 18:42:38 +0000 (18:42 +0000)]
Clarify when qx/STRING/ returns undef
Fixes #16572.
Dan Book [Thu, 12 Mar 2020 02:09:49 +0000 (22:09 -0400)]
perlrun - Update PERLIO documentation
- Remove mention of several layers that have no business being set in PERLIO
- Clarify the role of :crlf and :stdio
- Update mentioned versions to indicate state of things in 5.30
- Consistently refer to layers with a leading colon
Dan Book [Wed, 18 Dec 2019 21:35:01 +0000 (16:35 -0500)]
IPC::Open2 and IPC::Open3 documentation updates
* Remove direct usage of bareword filehandles and use lexical filehandles for the first example in each synopsis.
* Add examples using STDIN and STDOUT filehandles, and examples using already open filehandles, with explicit examples of where these handles come from.
* Declare variables with 'my' where appropriate and condense declarations inline.
* Add comments in synopsis describing the purpose of each example.
* Consistency of referencing synopsis variables from the description.
* Replace ambiguous phrase 'null string' with 'empty string or undefined' which is also more correct here.
* Add links to referenced CPAN modules and manpages.
* Better describe the reason for using gensym in IPC::Open3 and how to use it.
Nicolas R [Wed, 11 Mar 2020 21:40:01 +0000 (15:40 -0600)]
Add strict and warnings to some .PL files
use a convoluted incantation to be able to set
'use strict; use warnings' only for Perl > 5.6
Nicolas R [Thu, 12 Mar 2020 22:42:24 +0000 (16:42 -0600)]
Add strict and warnings to a few utils
Yves Orton [Sat, 8 Feb 2020 09:51:48 +0000 (10:51 +0100)]
op.c: change Optype to I32 for cmpchain functions
Optype appears to be almost completely unused, and on Win32 builds
we saw warnings from the cmpchain patches:
perly.y(1063) : warning C4244: 'function' : conversion from 'I32' to 'Optype', possible loss of data
perly.y(1065) : warning C4244: 'function' : conversion from 'I32' to 'Optype', possible loss of data
perly.y(1079) : warning C4244: 'function' : conversion from 'I32' to 'Optype', possible loss of data
perly.y(1081) : warning C4244: 'function' : conversion from 'I32' to 'Optype', possible loss of data
Reviewing the code I noticed that functions like Perl_newBINOP() have
an I32 type argument, and functions like OpTYPE_set() coerce such
arguments into type OPCODE:
#define OpTYPE_set(o,type) \
STMT_START { \
o->op_type = (OPCODE)type; \
o->op_ppaddr = PL_ppaddr[type]; \
} STMT_END
this patch changes the signature to the new cmpchain functions so that
they do they same, and change the type for storage for op_type values
to also use OPCODE like most of the other op.c code.
Zefram [Fri, 7 Feb 2020 11:49:07 +0000 (11:49 +0000)]
pod/perlop.pod: cross-precedence chaining
Warn explicitly that chainable operators don't chain with operators of
different precedence.
Zefram [Fri, 7 Feb 2020 09:30:21 +0000 (09:30 +0000)]
pod/perlop.pod: expand doc on chained comparisons
Zefram [Wed, 5 Feb 2020 07:43:14 +0000 (07:43 +0000)]
chained comparisons
Tomasz Konojacki [Thu, 12 Mar 2020 23:15:37 +0000 (00:15 +0100)]
pp_sort.c: silence the "unused parameter" warning
The 'flags' argument has been unused since
044d25c73ce10d2b29008b875209d414303ccff7 but we can't remove it
because it's a public API.
Fixes #17632
Nicolas R [Fri, 13 Mar 2020 01:10:34 +0000 (19:10 -0600)]
PerlIO bump VERSION for t/porting/cmp_version
James E Keenan [Fri, 7 Feb 2020 01:26:44 +0000 (20:26 -0500)]
Update $VERSION
To keep make test_porting happy.
Yves Orton [Thu, 6 Feb 2020 06:11:20 +0000 (07:11 +0100)]
B::Deparse fixup uninitialized error in deparsing weird glob statement
This fixes issue #17537, and adds tests
Tony Cook [Wed, 4 Mar 2020 05:27:35 +0000 (16:27 +1100)]
I think "program scope" is clearer here than "current file scope"
Further clarified it has no effect on modules.
"main program scope" is even clearer, credit to github comments.
Clarifies a documentation nit discussed in #17458
Dan Book [Wed, 11 Mar 2020 00:31:27 +0000 (20:31 -0400)]
Rework PerlIO documentation
- Add Layers section in the description, giving details of how layers work and encompassing the list of built-in layers
- Add various information relevant to modern usage of each layer
- Consistently refer to layers with a leading colon
- Redo :utf8 and :bytes layer descriptions
- Remove references to using the :utf8 layer for UTF-8 translation
- Add :scalar layer
- Move description of default layers that was oddly in "Querying" section to the end of "Defaults" section
- Correct default layers to specify that PERLIO=:stdio will always result in default layers of :stdio
- Update all examples to be strict-safe and check for open/binmode failure
- Capitalize references to Perl consistently
Nicolas R [Thu, 12 Mar 2020 21:14:26 +0000 (15:14 -0600)]
Revert "fixup to "avoid identical stack traces""
This reverts commit
fb8188b84d8a8f34f90aa9a8d9837892967f6b93.
Unfortunately this is causing some errors during global destruction
like:
Unbalanced string table refcount: (1) for "open_IN" during global destruction
It seems to be flapping, and recompiling Perl could see or not the
issue.
Upstream-URL: https://github.com/Perl/perl5/commit/
fb8188b84d8a8f34f90aa9a8d9837892967f6b93
Nicolas R [Thu, 12 Mar 2020 15:04:14 +0000 (09:04 -0600)]
Isolate broken 32bit gcc smokers
32bits smokers are broken and installing
'dpkg --add-architecture i386' fails on all debian.
Isolate them in order to avoid to have to install i386
architecture.
David Mitchell [Thu, 12 Mar 2020 15:41:24 +0000 (15:41 +0000)]
docs: clarify effect of $^H, %^H, ${^WARNING_BITS}
See http://nntp.perl.org/group/perl.perl5.porters/257128
David Mitchell [Thu, 12 Mar 2020 14:14:24 +0000 (14:14 +0000)]
fixup to "avoid identical stack traces"
GH #15109, #17567
My original fix for this issue, v5.31.6-141-gf2f32cd638
made a shallow copy of &PL_compiling. However, for non-default
warning bits, this made two COPs share the malloced() cop_warnings,
and bad things ensured. In particular this was flagged up in:
GH #17567: "BBC: AYOUNG/OpenVZ-0.01.tar.gz"
The fix in this commit is to do a deep copy of the COP using
newSTATEOP().
Nicolas R [Thu, 12 Mar 2020 14:57:59 +0000 (08:57 -0600)]
CI do not abort a build too early
Currently the 32bit smokers are broken due to some
deps issues. We could consider disable them but it's
better that they do not impact other smokers.
Nicolas R [Thu, 12 Mar 2020 14:56:36 +0000 (08:56 -0600)]
Revert "Avoid failures from Install 32bit dependencies issues"
This reverts commit
29a8ce81089f5cf0be406bc203e22cbe4dc52584.
Richard Leach [Sat, 15 Feb 2020 01:34:57 +0000 (01:34 +0000)]
gh#10059 - potentially reduce -Wall warnings on plan9. Not tested.
Nicolas R [Wed, 11 Mar 2020 22:12:14 +0000 (16:12 -0600)]
Avoid failures from Install 32bit dependencies issues
Multiple CI build failed due to 32 bits dependencies
issues. Let's try to move them as optional.
Karl Williamson [Tue, 10 Mar 2020 04:27:34 +0000 (22:27 -0600)]
op.c: S_fold_constants_eval can't be inlined
Because it uses setjmp, is what g++ says
Karl Williamson [Tue, 10 Mar 2020 00:28:47 +0000 (18:28 -0600)]
Stop requesting inlining some functions in recomp.c
Pattern compilation is not a performance critical process; there's no
need to request these to be inlined. Let the compiler decide, given
they are static anyway. This came up because g++ was warning they
weren't getting inlined anyway.
Karl Williamson [Mon, 9 Mar 2020 23:47:09 +0000 (17:47 -0600)]
Revert "croak_memory_wrap is an inline function."
This reverts commit
6c714a09cc08600278e72aea1fcdf83576d061b4.
croak_memory_wrap is designed to save a few bytes of memory, and was
never intended to be inlined. This commit moves it to util.c where the
other croak functions are.
Hugo van der Sanden [Tue, 10 Mar 2020 19:05:55 +0000 (13:05 -0600)]
regexec.c: Clean up debug call
The code this replaces relies on the internal structure of a macro,
which can change and break things. This commit changes to use a more
straight forward way of accomplishing the same thing.
Karl Williamson [Wed, 11 Mar 2020 22:16:18 +0000 (16:16 -0600)]
Rmv obsolete function
Use of this function was removed as part of adding wildcarding to the
Unicode name property
Karl Williamson [Fri, 6 Mar 2020 00:25:26 +0000 (17:25 -0700)]
use re qw(debug foo) should warn
Instead, foo was silently ignored
Karl Williamson [Tue, 25 Feb 2020 05:25:07 +0000 (22:25 -0700)]
Allow debugging from regexec.c back to regcomp.c
The compilation of User-defined properties in a regular expression that
haven't been defined at the time that pattern is compiled is deferred
until execution time. Until this commit, any request for debugging info
on those was ignored.
This fixes that by
Karl Williamson [Thu, 20 Feb 2020 20:14:56 +0000 (13:14 -0700)]
regcomp.c: Update comments
Karl Williamson [Thu, 20 Feb 2020 19:27:53 +0000 (12:27 -0700)]
lib/charnames.t: White-space only
Karl Williamson [Wed, 11 Mar 2020 20:23:18 +0000 (14:23 -0600)]
regen/opcodes: Clarify comment
Nicolas R [Wed, 11 Mar 2020 17:15:26 +0000 (11:15 -0600)]
make_ext.pl should use current Perl to run Makefile.PL
Karl Williamson [Fri, 6 Mar 2020 21:18:45 +0000 (14:18 -0700)]
Add thread safety to some environment accesses
The previous commit added a mutex specifically for protecting against
simultaneous accesses of the environment. This commit changes the
normal getenv, putenv, and clearenv functions to use it, to avoid races.
This makes the code simpler in places where we've gotten burned and
added stuff to avoid races. Other places where we haven't known we were
getting burned could have existed until now. Now that comes
automatically, and we can remove the special cases we earlier stumbled
over.
getenv() returns a pointer to static memory, which can be overwritten at
any moment from another thread, or even another getenv from the same
thread. This commit changes the accesses to be under control of a
mutex, and in the case of getenv, a mortalized copy is created so that
there is no possible race.
Karl Williamson [Thu, 20 Feb 2020 23:51:31 +0000 (16:51 -0700)]
Add mutex for accessing ENV
Karl Williamson [Tue, 10 Mar 2020 04:21:31 +0000 (22:21 -0600)]
Create new PUSHSTACKi for regcomp.c
See previous commit.
Karl Williamson [Mon, 9 Mar 2020 23:29:22 +0000 (17:29 -0600)]
cop.h: Add comment
Karl Williamson [Sat, 15 Feb 2020 21:28:32 +0000 (14:28 -0700)]
Implement \p{Name=/.../} wildcards
This commit adds wildcard subpatterns for the Name and Name Aliases
properties.
Karl Williamson [Mon, 9 Mar 2020 22:57:23 +0000 (16:57 -0600)]
charnames.pm: Make a variable ReadOnly
This is in preparation for exporting it in the next commit.
Karl Williamson [Mon, 24 Feb 2020 20:35:01 +0000 (13:35 -0700)]
mktables: Calculate legal chars in algorithmic names
Many ideographic character names are of the form 'prefix-code_point'.
For these, we know that the legal names are just the ones in the prefix,
the dash, and uppercase hex digits. This commit for each series of
these types of names figures out what characters are legal in that
series, and adds that info to the hash describing the series. This will
be used in a later commit to rule out entire series when matching
under some circumstances, without having to try any individual matches
within it.
Karl Williamson [Mon, 9 Mar 2020 22:26:52 +0000 (16:26 -0600)]
lib/_charnames.pm: Fix comment
Karl Williamson [Thu, 13 Feb 2020 16:04:41 +0000 (09:04 -0700)]
Reformat lib/unicore/Name.pl
This changes the format of this generated file so that it can more
easily be used with the Unicode Name property in wildcard matching.
Each line will now end with \n\n, and the \t characters are replaced by
\n. Thus an entry will look like
00001\nSTART OF HEADING\n\n
This makes matching of user-defined patterns using anchors work under
/m, which commit
4829f32decd128e6a122bd8ce35fe944bd87f104 forces. That
commit also changed some anchors' defintions to make them match \n under
/m with wildcards, so this makes it all transparent to user patterns.
The double \n\n at the end of an entry is so that the code can
distinguish between a line that contains a code point vs a name without
relying on the content; it is a disambiguator, like the \t that used to
be.
Karl Williamson [Thu, 5 Mar 2020 03:19:01 +0000 (20:19 -0700)]
ext/re/re.pm: Fix up setting debug option defaults
This was not setting the defaults properly for 'debug', and 'Debug'
Karl Williamson [Thu, 5 Mar 2020 02:58:33 +0000 (19:58 -0700)]
regcomp.h: Combine two macros into one
One of these macros is no longer used, so just combine them.
Richard Leach [Sun, 8 Mar 2020 13:09:30 +0000 (13:09 +0000)]
regexp.h: no subbeg move when reordering regexp struct
Richard Leach [Tue, 25 Feb 2020 00:15:32 +0000 (00:15 +0000)]
regexp.h -reorder regexp to close x86-64 alignment holes
David Cantrell [Fri, 6 Mar 2020 10:15:01 +0000 (10:15 +0000)]
add the missing =back
David Cantrell [Fri, 6 Mar 2020 00:21:47 +0000 (00:21 +0000)]
minor changes from review