This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Zefram [Sun, 12 Nov 2017 05:58:36 +0000 (05:58 +0000)]
better document macros taking literal strings
When giving a function-style prototype for a macro taking a literal string
parameter, put a string literal in place of a type for that parameter.
This goofy appearance makes it obvious that this isn't really a function,
and clues the reader in that the parameter can't actually be an arbitrary
expression of the right type. Also change the nonsensical "NUL-terminated
literal string" to "literal string" to describe these parameters.
Fixes [perl #116286].
Zefram [Sun, 12 Nov 2017 04:16:13 +0000 (04:16 +0000)]
document IO::Select error detection
Lukas Mai [Sun, 12 Nov 2017 01:58:32 +0000 (02:58 +0100)]
prevent invalid memory access in S_check_uni (RT #132433)
Daniel Dragan [Sun, 16 Aug 2015 08:30:23 +0000 (04:30 -0400)]
fix do dir returning no $!
do()ing a directory was returning false/empty string in $!, which isn't
an error, yet documentation says $! should have the error code in it.
Fix this by returning EISDIR for dirs, and EINVAL for block devices.
[perl #125774]
Remove "errno = 0" and comment added in
b2da7ead68, since now there is no
scenario where errno is uninitialized, since the dir and block device
failure branches now set errno, where previously they didn't.
Zefram [Sat, 11 Nov 2017 23:58:32 +0000 (23:58 +0000)]
avoid reading errno twice in a row
Reading errno can involve calling a function and indirecting through
its result, so cache the value of errno where possible. [perl #122096]
Zefram [Sat, 11 Nov 2017 23:21:48 +0000 (23:21 +0000)]
suppress clang warning in inode number handling
The gcc warning was already suppressed, but clang needs a different
formulation.
Lukas Mai [Sat, 11 Nov 2017 17:18:14 +0000 (18:18 +0100)]
teach makedef.pl about PL_keyword_plugin_mutex
This fixes t/porting/globvar.t.
Father Chrysostomos [Fri, 10 Nov 2017 21:57:33 +0000 (13:57 -0800)]
perldelta for reënabling of CV optimization
Father Chrysostomos [Sun, 29 Oct 2017 18:21:45 +0000 (11:21 -0700)]
Revert "Temporarily revert CV-in-stash optimisation"
This reverts commit
6eed25e2537643b77650cb3e4514ec9dc2e97d74.
Lukas Mai [Sat, 11 Nov 2017 12:35:13 +0000 (13:35 +0100)]
Revert "Simplify _MEM_WRAP_NEEDS_RUNTIME_CHECK()"
This reverts commit
004073bac990d90244eb463f435c52d4040b36df.
Lukas Mai [Sat, 11 Nov 2017 12:34:20 +0000 (13:34 +0100)]
fix MEM_SIZE_MAX definition
Zefram [Sat, 11 Nov 2017 12:44:49 +0000 (12:44 +0000)]
perldelta entry for perlguts revision
Zefram [Sat, 11 Nov 2017 12:20:40 +0000 (12:20 +0000)]
better documentation of reference counts
Lukas Mai [Sat, 11 Nov 2017 10:19:05 +0000 (11:19 +0100)]
Merge wrap_keyword_plugin() into blead
Lukas Mai [Thu, 9 Nov 2017 00:19:58 +0000 (01:19 +0100)]
perldelta entry for wrap_keyword_plugin
Lukas Mai [Thu, 9 Nov 2017 00:00:23 +0000 (01:00 +0100)]
test wrap_keyword_plugin (RT #132413)
Lukas Mai [Wed, 8 Nov 2017 23:59:53 +0000 (00:59 +0100)]
add wrap_keyword_plugin function (RT #132413)
Zefram [Sat, 11 Nov 2017 10:05:53 +0000 (10:05 +0000)]
avoid runtime module loading in File::Spec
Incidentally remove the ->_cwd method from the subclassing interface of
File::Spec::Unix, in favour of direct calls to Cwd::getcwd().
Zefram [Sat, 11 Nov 2017 07:40:20 +0000 (07:40 +0000)]
return inode numbers as strings where necessary
We previously used a lossy conversion of inode numbers to floating point,
where they're too big to fit the IV/UV format. That sucks; a rounded
inode number is nearly useless. Instead, fall back to returning a
string of decimal digits. That preserves the entire value, for code
that looks at it in the right way, and collapses to the former fallback
in other situations.
Todd Rinaldo [Sat, 11 Nov 2017 07:08:34 +0000 (01:08 -0600)]
[MERGE] Remove unnecessary use of 'use vars'
Todd Rinaldo [Sat, 11 Nov 2017 07:03:26 +0000 (01:03 -0600)]
Document the removal of use vars from sources
Nicolas R [Wed, 13 Sep 2017 22:52:16 +0000 (16:52 -0600)]
Replace multiple 'use vars' by 'our' in regen.
then run ./regen_perly.pl to update perly files
Todd Rinaldo [Sat, 11 Nov 2017 06:42:36 +0000 (00:42 -0600)]
Replace multiple 'use vars' by 'our' in t
Nicolas R [Tue, 12 Sep 2017 19:20:25 +0000 (13:20 -0600)]
Replace multiple 'use vars' by 'our' in utils
Using vars pragma is discouraged and has been superseded by 'our' declarations
available in Perl v5.6.0 or later.
Nicolas R [Tue, 12 Sep 2017 19:20:25 +0000 (13:20 -0600)]
Replace multiple 'use vars' by 'our' in ext
Using vars pragma is discouraged and has been superseded by 'our' declarations
available in Perl v5.6.0 or later.
This commit is about replacing the usage of 'vars' pragma
by 'our' in 'ext' directory.
Nicolas R [Tue, 12 Sep 2017 19:20:25 +0000 (13:20 -0600)]
Replace multiple 'use vars' by 'our' in lib
Using vars pragma is discouraged and has been superseded by 'our' declarations
available in Perl v5.6.0 or later.
This commit is about replacing the usage of 'vars' pragma
by 'our' in 'lib' directory.
Nicolas R [Tue, 12 Sep 2017 19:20:25 +0000 (13:20 -0600)]
Replace multiple 'use vars' by 'our' in dist
Using vars pragma is discouraged and has been superseded
by 'our' declarations available in Perl v5.6.0 or later.
Additionally using 'vars' pragma increase the memory consumption of a
program by about 700 kB for no good reason.
This commit is about replacing the usage of 'vars' pragma
by 'our' in blead where it makes sense. ( leaving 'cpan' directory
outside of the scope )
-- using vars
perl -e 'use vars qw(@ISA $AUTOLOAD $VERSION); print qx{grep RSS /proc/$$/status} '
VmRSS: 2588 kB
-- using our instead
perl -e 'our (@ISA, $AUTOLOAD, $VERSION); print qx{grep RSS /proc/$$/status} '
VmRSS: 1864 kB
Karl Williamson [Fri, 10 Nov 2017 02:23:13 +0000 (19:23 -0700)]
locale.c: Simplify code in Perl_langinfo()
Instead of a switch() statement we can use 'foo ? bar : baz;'
Zefram [Sat, 11 Nov 2017 04:06:59 +0000 (04:06 +0000)]
store AV iterator as mg_len in more cases
The iterator of an AV is an IV value attached to the AV via magic.
It may be stored in the space used by mg_len, or it may be stored in
separately allocated space referenced by mg_ptr. The former is more
efficient, so should be preferred. The original code for AV iterators
would use mg_len if IV was (the same size as) I32, because mg_len was of
type I32. Since then mg_len has been increased to type SSize_t, but the
conditional about how AV iterators are stored wasn't updated to match.
As a result, on the now very common 64-bit builds we were missing out on
the opportunity to use the more efficient form of storage. This commit
updates the condition about how AV iterators are stored, to take account
of the new type.
In principle AV iterators ought to be of type SSize_t, and thus *always*
storable as mg_len. But Perl_av_iter_p() is in the public API with
its IV* return type, so there is a compatibility issue to address in
changing that.
Todd Rinaldo [Fri, 10 Nov 2017 17:13:09 +0000 (11:13 -0600)]
Add support for --help and --version in perlbug
RT 130032: Thanks to Houston Perl Mongers for contributing to this work at
our monthly meeting!
NPD
Nicolas R [Fri, 10 Nov 2017 20:25:12 +0000 (13:25 -0700)]
PACKAGING: add patchlevel.h doc entry
Nicolas R [Fri, 10 Nov 2017 20:27:39 +0000 (13:27 -0700)]
.gitignore: git should also ignore *.bak files
Slaven Rezic [Thu, 9 Nov 2017 22:05:00 +0000 (16:05 -0600)]
Handle Linux containers' use of 0 for PPID with orphaned procs in t/op/getppid.t
Bug 130143: Travis-ci has moved to using docker for their testing environments.
However a Docker environment has multiple process trees so therefore orphaned
processes often get a Parent PID of 0 not 1. The previous unit test for this
considered 0 to be a failure. There is now special code to handle this exception
in the unit test for getppid.
Nicolas R [Thu, 9 Nov 2017 16:46:43 +0000 (09:46 -0700)]
Adjust travis.yaml configuration for blead merges.
- Unset PERL_BUILD_PACKAGING during builds
- Set JOBS to indicate how parallel we want builds to be (4)
- Assure tags are fetched to allow t/porting/cmp_version.t to build.
David Cantrell [Fri, 10 Nov 2017 13:06:00 +0000 (13:06 +0000)]
experimental::lexical_topic is no longer a warning category, it's a fatal compile-time error
Craig A. Berry [Fri, 10 Nov 2017 13:58:31 +0000 (07:58 -0600)]
Make VMS::Stdio declare PERL_EXT.
We haven't been able to compile this extension since
f55ac4a45513
because strBEGINs is not in the API and until now it has not
depended on anything not in the API. So declare the fact that
it's a core extension and can use core-only macros.
Chris 'BinGOs' Williams [Fri, 10 Nov 2017 09:34:40 +0000 (09:34 +0000)]
Update Unicode-Collate to CPAN version 1.21
[DELTA]
1.21 Sat Nov 4 10:49:19 2017
- mklocale: [rt.cpan.org #121664] . removed from @INC (take 2)
- DUCET is updated (for Unicode 9.0.0) as Collate/allkeys.txt.
* Please notice that allkeys.txt will be overwritten if you have had
other allkeys.txt already.
- The default UCA_Version is 34.
- added tangut.t in t.
- Locale/*.pl and CJK/Korean.pm are updated.
1.20 Fri Nov 3 11:50:21 2017
- XS: [rt.cpan.org #121664] . removed from @INC
- U::C::Locale newly supports locales: dsb, lkt.
Zefram [Fri, 10 Nov 2017 02:07:46 +0000 (02:07 +0000)]
parse yada-yada only as a statement
Commit
f5727a1c71878a34f6255eb1a506c0b21af7d36f tried to make yada-yada
be parsed consistently as a term expression, but actually things are
more complicated than that. The tokeniser didn't accept yada-yada in
the right contexts to make it usable as an expression, and changing
that would require decisions on resolving ambiguities between yada-yada
and flip-flop. It's also documented as being a statement rather than
an expression, though with some incorrect information about ambiguities.
Overall it looks more like the intent was for yada-yada to be a statement.
This commit makes it grammatically treated as such, and also fixes up
the dubious parts of the documentation. [perl #132150]
Karl Williamson [Fri, 10 Nov 2017 01:46:17 +0000 (18:46 -0700)]
sv.c: Fix typo in comment
Karl Williamson [Fri, 10 Nov 2017 01:38:02 +0000 (18:38 -0700)]
malloc.c: Fix typo in comment
Karl Williamson [Fri, 10 Nov 2017 01:37:30 +0000 (18:37 -0700)]
lib/locale.t: Clarify test name
Karl Williamson [Fri, 10 Nov 2017 01:26:43 +0000 (18:26 -0700)]
handy.h: Clarify comment
Karl Williamson [Tue, 12 Sep 2017 00:57:54 +0000 (18:57 -0600)]
locale.c: strerror_l() not fool proof
Commit
7aaa36b196e5a478a3d1bd32506797db7cebf0b2 changed to use
strerror_l() if available on the platform. But there is a potential bug
with this on threaded perls. The code uses strerror_l() when it needs
the answer on a locale that isn't necessarily the current one. But it
uses plain strerror() when the locale is known to be the current one.
Plain strerror() isn't necessarily thread-safe. However, on systems
that have strerror_r(), reentr.h has caused our apparent call to plain
strerror() to instead call the thread-safe strerror_r() under the hood.
So there is no bug on unthreaded perls nor on ones that have
strerror_r().
This commit fixes the bug on threaded builds which have strerror_l() but
not strerror_r(). It does this by using strerror_l() for everything,
and constructing a locale object that is the current locale to use when
the locale doesn't need to be changed. This is somewhat more work than
the alternative above does, so that one is used if available.
No changes are made to how it works on systems that don't have
strerror_l().
Some systems have deprecated strerror_r(). reentr.h does not use it on
such systems. The reason for the deprecation, we would hope, may be
that the plain strerror() is implemented thread-safely. We don't know
that, so we just assume that the plain version is thread-unsafe.
We do have tests that try to find races here, but they haven't shown
any. It could be that systems that are advanced enough to have
strerror_l() also have strerror_r().
Karl Williamson [Thu, 14 Sep 2017 03:05:20 +0000 (21:05 -0600)]
locale.c: Move a #define to earlier in the file
This is in prep for a future commit which needs it earlier
Karl Williamson [Mon, 11 Sep 2017 17:05:56 +0000 (11:05 -0600)]
locale.c: Add #define's
The previous commit added arrays of locale categories. This commit
creates compile-time mappings from the category number to the index it
has in the array. It also changes to use the #define for the index of
LC_ALL in places it is expected to be defined. This causes bugs in this
logic to be found at compile time on systems that don't have LC_ALL.
Karl Williamson [Tue, 25 Jul 2017 20:23:33 +0000 (14:23 -0600)]
locale.c: Remove many #if conditionals
locale.c is full of compiler conditionals because platforms vary widely
(or have in the past) in what categories they use. Prior to this
commit, there were many sections of code which had copies of the same
constructs which were #ifdef'd so they'd run only on the categories that
are to be used in this build.
This duplication creates the opportunity for changes to get applied to
only some of the places that they should, and also makes it hard to
read.
This commit adds two parallel arrays that can map a category to/from its
name, and are defined with each element conditionally compiled in based
on the needs of the build. Doing the conditionals during array
construction means that most of the other conditionals can be replaced
by looping through the arrays. Thus the duplicated code is eliminated,
as well as almost 200 lines in this file.
Most of these loops get executed only at process initialization, so the
slight performance hit is inconsequential.
Lukas Mai [Thu, 9 Nov 2017 13:34:00 +0000 (14:34 +0100)]
Revert "perl.h: Use STMT_START { ... } STMT_END"
This reverts commit
11b2cef65dac01e8723c9a6f6e640665cb752a2c.
DECLARE_STORE_LC_NUMERIC_SET_TO_NEEDED seems to be unused, but the
previous commit made it a syntax error (unmatched '{').
It also doesn't make sense to wrap what is supposed to be a declaration
in a { } block.
Dagfinn Ilmari Mannsåker [Thu, 9 Nov 2017 13:22:40 +0000 (13:22 +0000)]
Fix missing close brace before STMT_END
The macro isn't actually used anywhere (in core or on CPAN)
Karl Williamson [Mon, 11 Sep 2017 23:24:00 +0000 (17:24 -0600)]
locale.c: Avoid potential read beyond buffer end
I noticed this flaw by code reading; I doubt that it's exploitable.
foldEQ assumes that both operands are at least as long as its length
parameter. In this case, it's possible that the codeset returned by
nl_langinfo is shorter than 5, in which case, it would try to access the
extra characters in the heap. Real codesets tend to be longer than
this, so an attacker would likely have to install a locale with a
made-up codeset whose name is shorter.
Even the C locale is longer: "ANSI_X3.4-1968"
Karl Williamson [Wed, 13 Sep 2017 22:03:53 +0000 (16:03 -0600)]
locale.c: Clarify some debug statements
Karl Williamson [Tue, 12 Sep 2017 00:56:49 +0000 (18:56 -0600)]
locale.c: Slight refactor
This makes savepv() part of the expressions instead of a separate
statement.
Karl Williamson [Mon, 11 Sep 2017 23:41:57 +0000 (17:41 -0600)]
locale.c: Use REPLACEMENT_CHARACTER as a test
This is trying to determine if the locale is UTF-8. The easiest way to
tell is if the codeset returned by nl_langinfo says UTF-8, but if that
fails or nl_langinfo() is not present on the system, a fallback method
is to use the libc routines to convert a known byte string to code point
and see if that matches the expected Unicode code point. Prior to this
patch, the byte string representing HYPHEN was used. That's probably
good enough, but we can do better with no extra work. This commit
changes to use the REPLACEMENT CHARACTER instead. That is a Unicode
concept. The chances of a non-UTF-8 locale taking the UTF-8 byte string
for the REPLACEMENT and evaluating to REPLACEMENT are vanishingly small.
Karl Williamson [Mon, 11 Sep 2017 23:32:42 +0000 (17:32 -0600)]
locale.c: Avoid extra call to mbtowc()
This is done only when debugging, but in some locales that have shift
states, the extra call could blow up. Instead save the result of the
mbtowc() call we care about.
Karl Williamson [Mon, 11 Sep 2017 23:19:05 +0000 (17:19 -0600)]
locale.c: Add macro
This adds STRLENs() where the argument must be a literal string
constant.
This may deserve wider applicability, but in case it doesn't, I'm making
it local to just this file.
Karl Williamson [Mon, 11 Sep 2017 22:10:42 +0000 (16:10 -0600)]
locale.c: Rmv extraneous detail from comment
This comment contains a list of code points that are unusual, but it
also included ones that are standard, which made me keep looking to see
why they were unusual, each time realizing in the end that they were
not.
Karl Williamson [Mon, 28 Aug 2017 23:51:06 +0000 (17:51 -0600)]
embed.fnc: Change fcn from A to X
This function is marked as accessible anywhere, but experimental, and
so is changeable at any time without notice, and its name begins with an
underscore to indicate its private nature. I didn't know at the time I
wrote it that we have an existing mechanism to deal with functions whose
only use should be a public macro. This changes to use that mechanism.
Karl Williamson [Mon, 28 Aug 2017 23:43:29 +0000 (17:43 -0600)]
Change name of internal function
Following on the previous commit, this changes the name of the function
that changes the variable to be in sync with it.
Karl Williamson [Mon, 28 Aug 2017 23:21:09 +0000 (17:21 -0600)]
Change name of locale per-interpreter variable
The real purpose of this internal variable is to give the name of the
locale that is the underlying one for the C program. Various macros
already indicate that. This furthers the process.
Karl Williamson [Thu, 9 Nov 2017 03:31:50 +0000 (20:31 -0700)]
POSIX.xs is PERL_EXT
Specifying so automatically gets the reentrant versions of various libc
functions in threaded perls, lowering race condition odds.
Karl Williamson [Thu, 9 Nov 2017 03:18:10 +0000 (20:18 -0700)]
Bump version of B/t/OptreeCheck to 0.16
Karl Williamson [Thu, 9 Nov 2017 03:16:34 +0000 (20:16 -0700)]
Bump version of B/O.pm to 1.03
Karl Williamson [Mon, 28 Aug 2017 23:16:27 +0000 (17:16 -0600)]
perl.h: Use STMT_START { ... } STMT_END
This should be used in macros that have statements.
Karl Williamson [Mon, 28 Aug 2017 23:11:29 +0000 (17:11 -0600)]
perl.h: White-space only
Indent some nested #defines, remove an extra empty line
Karl Williamson [Thu, 10 Aug 2017 22:03:16 +0000 (16:03 -0600)]
toke.c: Add comment
Karl Williamson [Thu, 10 Aug 2017 21:52:35 +0000 (15:52 -0600)]
Dest buffer needs to be bigger for utf16_to_utf8()
These undocumented functions require the destination buffer to have the
worst case size. However that size (previously listed as 3/2 * input)
is wrong for EBCDIC. Correct the comments, and the single use of these
in core.
These functions do not have a way to avoid overflowing, which strikes me
as wrong.
Karl Williamson [Thu, 10 Aug 2017 20:33:40 +0000 (14:33 -0600)]
_byte_dump_string(): Don't output leading space
This changes this function to not put an initial space character in the
returned string.
Karl Williamson [Fri, 11 Aug 2017 03:39:06 +0000 (21:39 -0600)]
POSIX.xs: Move constant tests out of loop
Whether or not a locale is in UTF-8 doesn't change in this loop;
calculate it once, prior to the loop
Karl Williamson [Tue, 1 Aug 2017 18:41:12 +0000 (12:41 -0600)]
numeric.c: Refactor #if #else in Perl_my_aotf
This simplifies things, eliminating nested #if's
Karl Williamson [Tue, 1 Aug 2017 18:38:09 +0000 (12:38 -0600)]
numeric.c: Rename some variables
The new names are clearer.
Karl Williamson [Mon, 24 Jul 2017 04:08:50 +0000 (22:08 -0600)]
Perl_locale(): Refactor for clarity
This code is full of 'if's interrupted by #ifdefs, which makes it hard
to read. Changing it to a switch() makes it much easier to understand.
Karl Williamson [Mon, 24 Jul 2017 03:53:28 +0000 (21:53 -0600)]
locale.c:sync_locale(): Add debugging info
Karl Williamson [Mon, 24 Jul 2017 03:39:46 +0000 (21:39 -0600)]
locale.c:sync_locale(): Rmv useless call
This was changing to use the locale's radix, but this is unnecessary for
the later things in this function, and those change things to use dot,
so this call is useless.
Karl Williamson [Thu, 14 Sep 2017 19:32:58 +0000 (13:32 -0600)]
locale.c: Use new nl_langinfo equivalent
This converts the final plain nl_langinfo() function call in locale.c to
use the new equivalent that is more thread safe, and you don't have to
free the returned memory. There was an unlikely leak before this, if
the return was somehow "".
Karl Williamson [Thu, 14 Sep 2017 03:17:28 +0000 (21:17 -0600)]
locale.c: Rmv erroneous complement operator
The extra '!' that snuck in there caused this code to not work properly.
Fortunately, it doesn't get used except as a last resort, and that
apparently hasn't happened so as to have gotten reported from the field.
A test can't be added because it would only occur on a system that had
bad locales.
Karl Williamson [Thu, 14 Sep 2017 18:44:40 +0000 (12:44 -0600)]
locale.c: Refactor locale macros
This standardizes things to make things easier to understand and prepare
for future commits
Karl Williamson [Fri, 21 Jul 2017 01:16:55 +0000 (19:16 -0600)]
locale.c: Convert setlocale() calls to macros
This will be useful in future commits
Karl Williamson [Wed, 19 Jul 2017 17:34:08 +0000 (11:34 -0600)]
locale.c: Change static fcn name
The new name more closely reflects what it does
Karl Williamson [Thu, 20 Jul 2017 22:20:01 +0000 (16:20 -0600)]
locale.c: Refactor static fcn to save work
This adds a parameter to the function that sets the radix character for
floating point numbers. We know that the radix by default is a dot, so
no need to calculate it in that case.
This code was previously using localeconv() to find the locale's decimal
point. The just added my_nl_langinfo() fcn does the same with an easier
API, and is more thread safe, and automatically switches to use
localeconv() when n nl_langinfo() isn't available, so revise the
conditional compilation directives that previously were necessary, and
collapse directives that were unnecessarily nested.
And adjust indentation
Karl Williamson [Tue, 12 Sep 2017 01:12:56 +0000 (19:12 -0600)]
locale.c: Create extended internal Perl_langinfo()
This extended version allows it to be called so that it uses the current
locale for the LC_NUMERIC, instead of toggling to the underlying one.
(This can be useful when in the middle of things.)
This ability won't be used until the next commit
Karl Williamson [Thu, 20 Jul 2017 22:24:42 +0000 (16:24 -0600)]
locale.c: Rmv redundant fcn call
This function is called as part of the call made in the line before. No
need to do it twice.
Karl Williamson [Sun, 16 Jul 2017 00:19:48 +0000 (18:19 -0600)]
locale.c: White-space, comment, rearrange some #else
This file is full of conditional compilation, due to the fact that
locale support has been highly variable in the OSes Perl has operated
on. This commit properly indents nested compiler directives, and makes
sure there is a blank line between the directives and real code. I find
that much easier to read. It also re-orders some
#ifdef some_feature
Many lines of code handling feature
#else
1 to 3 lines of trivial code to avoid compilation warnings
#endif
to
#ifndef some_feature
1 to 3 lines of trivial code to avoid compilation warnings
#else
Many lines of code handling feature
#endif
Otherwise the trivial code may be hundreds of lines from the original
'#if', which makes it hard to grok.
This commit also clarifies and fixes typos in comments, and removes some
obsolete comments.
Todd Rinaldo [Wed, 8 Nov 2017 22:39:12 +0000 (16:39 -0600)]
Merge branch 'BO' into blead
Make it simpler to divine if modules are there because of loading B/O or
because the actual program used them.
NPD
Todd Rinaldo [Wed, 13 Sep 2017 19:35:39 +0000 (14:35 -0500)]
ext/B/t/strict.t: Assure B.pm and O.pm pass strict and warnings checks.
We need to test these in unit tests since they do not load these modules to
prevent pollution of the stash in compilers.
Todd Rinaldo [Wed, 13 Sep 2017 19:35:35 +0000 (14:35 -0500)]
Fix warnings (used once) for O.pm
Todd Rinaldo [Wed, 13 Sep 2017 19:35:30 +0000 (14:35 -0500)]
Fix warnings (used once) for B.pm
Todd Rinaldo [Wed, 13 Sep 2017 19:35:21 +0000 (14:35 -0500)]
Remove unnecessary module loads from B and O
This commit removes multiple unnecessary modules so that
perl -MO= can hand back to compile as cleanly as possible.
This change caused significant jitter in tests for B::Concise. While updating
the test to the new reality, OptreeCheck.pm was corrected to stop stripping
regexes off $got when it started failing so it would be easier to see where
the failure happened.
Nicolas R [Wed, 8 Nov 2017 22:30:37 +0000 (15:30 -0700)]
Simplify travis.yml config for Continuous Integration
The goal is to have a quick smoke on travis smokers
to plug in short future CI for any new commits/PR.
NPD
Lukas Mai [Wed, 8 Nov 2017 22:05:35 +0000 (23:05 +0100)]
restore error message for unterminated strings
The previous strchr/memchr changes inadvertently broke the error message
for perl -e '"'. Instead of
Can't find string terminator '"' anywhere before EOF
it became
Can't find string terminator """ anywhere before EOF
Nicolas R [Mon, 6 Nov 2017 23:44:17 +0000 (16:44 -0700)]
disable t/porting/authors.t for distro packaging
NPD
Nicolas R [Mon, 6 Nov 2017 23:42:08 +0000 (16:42 -0700)]
disable t/porting/podcheck.t for distro packaging
NPD
Nicolas R [Wed, 8 Nov 2017 15:56:20 +0000 (08:56 -0700)]
Allow custom PL_strtab hash in perl_construct.
Such a patch allow PL_strtab optimizations at compile time
to statically malloc PL_strtab to an optimized size at startup.
Custom entries can then be added (after PL_hash_seed initialization)
without risking the hash to be reset by perl_construct.
Lukas Mai [Wed, 8 Nov 2017 10:45:05 +0000 (11:45 +0100)]
PERL_STRLEN_ROUNDUP: parenthesize macro parameter
Also:
- factor out common expression
- remove redundant double parens
- add spaces to expression
Karl Williamson [Tue, 7 Nov 2017 22:56:32 +0000 (15:56 -0700)]
toke.c: Fix wrong use of memrchr
This was a replacement of strchr(), so should not have used the
find-right-most memrchr.
This was spotted by Christian Hansen. I don't know what the
implications are, but thought I should get a fix in immediately.
Karl Williamson [Tue, 7 Nov 2017 19:52:09 +0000 (12:52 -0700)]
Blead breaks DBD::SQLite
This partially reverts
0f12654f40.
The particular spot being reverted is in gv.c, and the change did not
take into account all the nuances involved, so simply revert it. I
believe what is happening is that a negative number is being generated
and treated as a very large number. Instead the code should retain the
original test that it was ok to do the subtraction, before actually
doing it.
Craig A. Berry [Tue, 7 Nov 2017 03:13:24 +0000 (21:13 -0600)]
Two fix-ups following
b59bf0b288.
In one case, memEQs was missing a length parameter, and in the
other, two opening braces had been removed but only one closing
brace.
Nicolas R [Mon, 6 Nov 2017 23:10:21 +0000 (16:10 -0700)]
toke.c: use my_memrchr helper for portability [round 2]
compilation broken on darwin using clang
Nicolas R [Mon, 6 Nov 2017 23:03:03 +0000 (16:03 -0700)]
Use my_memrchr helper for portability
Recent commit '
8725053bce' breaks darwin compilation.
We should use my_memrchr helper to avoid
portability issues, instead of calling
directly memrchr.
Karl Williamson [Mon, 6 Nov 2017 21:32:14 +0000 (14:32 -0700)]
Merge branch 'convert strchr to memchr' into blead
Using C string functions on Perl strings doesn't work properly if they
contain embedded NULs. This can happen with Perl program text, for
example, and even if the NUL is illegal, the generated diagnostics are
likely to be misleading as the parsing would have terminated
prematurely.
I have done an audit on core for cases where C string functions are used
in contexts where a Perl string is being processed. This came down to
uses of strchr() and strrchr(). This branch changes many of them to
memchr() and memrchr() respectively. Not all uses of these functions
need change, as there are places where C strings are what is being
processed, such as dealing with OS strings that are NUL terminated.
File paths and environ are two examples.
Also, memchr and memrchr tend to be faster than their str equivalents,
as they only need to look for one termination condition, and there may
be hardware assistance on some platforms. Further, memrchr knows
exactly where to start looking, instead of having to find the NUL ending
the string (strrchr is likely to be implemented as iterating over the
string using strchr from the left, over and over until it fails).
I may have converted some str functions to mem ones unnecessarily, as I
didn't check in full detail if some were operating only on C strings, but
given that the mem ones are faster, this is OK
Karl Williamson [Sat, 25 Mar 2017 21:06:58 +0000 (15:06 -0600)]
toke.c: Convert some strchr to memchr
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information.
Karl Williamson [Thu, 2 Nov 2017 20:01:54 +0000 (14:01 -0600)]
toke.c use memBEGINs with prev commit