This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
8 years agot/re/reg_mesg.t: Add a couple of tests
Karl Williamson [Tue, 16 Feb 2016 19:08:20 +0000 (12:08 -0700)]
t/re/reg_mesg.t: Add a couple of tests

8 years agominor comment improvements in hv.h and scope.h
Daniel Dragan [Thu, 11 Feb 2016 10:48:58 +0000 (05:48 -0500)]
minor comment improvements in hv.h and scope.h

-perl doesn't use malloc, it uses Newx (per interp memory)
-say what the return type is of SSNEW

8 years agoRevert "tweak NOT_REACHED in DEBUGGING builds"
Lukas Mai [Mon, 15 Feb 2016 20:17:18 +0000 (21:17 +0100)]
Revert "tweak NOT_REACHED in DEBUGGING builds"

This reverts commit 5b48e25f83f62f48ea280c49b00302e063384348.

The above commit breaks win32 builds:

    IO.xs(73) : error C2065: 'my_perl' : undeclared identifier
    IO.xs(73) : error C2223: left of '->IProc' must point to struct/union

where dist/IO/IO.xs contains:

    69: static int
    70: not_here(const char *s)
    71: {
    72:     croak("%s not implemented on this architecture", s);
    73:     NORETURN_FUNCTION_END;
    74: }

and perl.h contains:

    #  define NORETURN_FUNCTION_END NOT_REACHED;

8 years agodoop.c: fix typo in header comment
David Mitchell [Mon, 15 Feb 2016 15:37:33 +0000 (15:37 +0000)]
doop.c: fix typo in header comment

8 years agoperldelta: move the two Win32 gmake improvements to where they belong
Tony Cook [Mon, 15 Feb 2016 02:05:18 +0000 (13:05 +1100)]
perldelta: move the two Win32 gmake improvements to where they belong

8 years agofix win32 gmake with win64 VC with 32 bit GCC in PATH build failure
Daniel Dragan [Sat, 13 Feb 2016 09:05:24 +0000 (04:05 -0500)]
fix win32 gmake with win64 VC with 32 bit GCC in PATH build failure

The assignment of PROCESSOR_ARCHITEW6432 to PROCESSOR_ARCHITECTURE near
the "When we are running from a 32bit cmd.exe on AMD64 then" comment
doesn't happen if WIN64 var was already assigned to. Do the 32/64 auto
detection only for GCC builds, not for VC builds. I not implementing 32/64
and cl version (CCTYPE setting) detection by parsing stdout of "cl<enter>"
with batch and gmake syntax at this time.

failure message:
generate_uudmap.obj : fatal error LNK1112: module machine type 'x64'
conflicts with target machine type 'X86'
GNUmakefile:1416: recipe for target '..\generate_uudmap.exe' failed
gmake: *** [..\generate_uudmap.exe] Error 2

8 years agoSkip the length sanity check if d_name is pointer or less.
Jarkko Hietaniemi [Sun, 14 Feb 2016 00:34:20 +0000 (19:34 -0500)]
Skip the length sanity check if d_name is pointer or less.

[perl #127511] v5.23.7-308-g1d41bb7 broke t/op/threads-dirh.t on solaris threaded builds

In other words, skip it if the dirent->d_name is a pointer (char *)
or less (struct-final char d_name[1], as it seems to be in Solaris).

The length sanity check is meant for places where the d_name is
a true array.

Follow-up to 1d41bb72.

8 years agoDynaLoader shouldn't use mod2fname when finding .bs files.
Craig A. Berry [Sat, 13 Feb 2016 22:29:14 +0000 (16:29 -0600)]
DynaLoader shouldn't use mod2fname when finding .bs files.

Some platforms (probably only VMS and Android at the moment) take
special steps via the function DynaLoader::mod2fname to construct
a dynamic library name that will be unique and (if too long)
truncated.  Then DynaLoader looks for a bootstrap file with the
exact same name as the dynamic library except with a .bs file
extension.

However, ExtUtils::MakeMaker has never produced bootstrap files
that have been run through mod2fname, so while a Foo:Bar extension
would produce a loadable library named PL__Foo_Bar.exe, the
bootstrap would be called Bar.bs. That shouldn't be a problem
since the bootstrap file is just Perl code read by Perl, but
DynaLoader has (apparently forever) been looking for
PL__Foo_Bar.bs and not finding it. So let's look for it by the
name under which it actually exists.

There are no core extensions that produce non-empty bootstrap
files and no existing test coverage, but as-yet-unintegrated
versions of MakeMaker do have such tests.  See, for example,

https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/commit/7f5e9a35addeea7ebfcded28277c85f723e1a5de

8 years agoSolaris /usr/bin/sed cannot handle labels of length eight.
Jarkko Hietaniemi [Sat, 13 Feb 2016 23:26:09 +0000 (18:26 -0500)]
Solaris /usr/bin/sed cannot handle labels of length eight.

You will just get a bunch of these from makedepend:

Finding dependencies for av.o.
Label too long: : testcont

According to POSIX, it should, eight being the minimum supported length.
Shoulda woulda coulda.  Label of length seven seems to be fine.

8 years agotweak NOT_REACHED in DEBUGGING builds
Lukas Mai [Sat, 13 Feb 2016 21:11:59 +0000 (22:11 +0100)]
tweak NOT_REACHED in DEBUGGING builds

Previously, NOT_REACHED was defined as ASSUME(0), which is assert(0) in
DEBUGGING builds.

On some platforms (HP-UX/IA64, others?) gcc doesn't know that assert(0)
never returns. We have some code of the form (simplified):

  int x;

  switch (A) {
    case B: x = 0; break;
    case C: x = 1; break;
    default: NOT_REACHED;
  }

  return x;

Now gcc thinks control can pass through the default branch and hit the
'return'. This triggers a warning of the form

warning: 'x' may be used uninitialized in this function
  [-Wmaybe-uninitialized]

This commit defines NOT_REACHED as abort() in DEBUGGING builds.
Hopefully every compiler knows that abort() can't return, thus getting
rid of the bogus warnings.

8 years agoTime::HiRes version bump.
Jarkko Hietaniemi [Sat, 13 Feb 2016 14:55:01 +0000 (09:55 -0500)]
Time::HiRes version bump.

8 years agoWhitespace only: zap EOL spaces
Jarkko Hietaniemi [Sat, 13 Feb 2016 16:38:30 +0000 (11:38 -0500)]
Whitespace only: zap EOL spaces

8 years agoAdd the Time-HiRes Changes file from CPAN.
Jarkko Hietaniemi [Sat, 13 Feb 2016 14:50:03 +0000 (09:50 -0500)]
Add the Time-HiRes Changes file from CPAN.

8 years agoAdd caveat on the clock_getres() resolution
Jarkko Hietaniemi [Thu, 14 Jan 2016 15:31:01 +0000 (10:31 -0500)]
Add caveat on the clock_getres() resolution

8 years agoMention the OS X get_clock...() emulations.
Jarkko Hietaniemi [Sat, 13 Feb 2016 15:52:46 +0000 (10:52 -0500)]
Mention the OS X get_clock...() emulations.

8 years agoOS X clock_nanosleep() emulation
Jarkko Hietaniemi [Thu, 14 Jan 2016 02:47:44 +0000 (21:47 -0500)]
OS X clock_nanosleep() emulation

https://developer.apple.com/library/ios/technotes/tn2169/_index.html
"High Precision Timers in iOS / OS X"

Returning the unspent time in the case of relative sleep is not implemented.

8 years agoOS X clock_gettime() and clock_getres() emulation
Jarkko Hietaniemi [Thu, 14 Jan 2016 13:06:26 +0000 (08:06 -0500)]
OS X clock_gettime() and clock_getres() emulation

Note that CLOCK_REALTIME and CLOCK_MONOTONIC are the same clock,
so both are monotonic.

The difference is that the CLOCK_REALTIME is offset by the
gettimeofday() result on the first use of these interfaces,
and thereafter will closely track the gettimeofday() values.

https://developer.apple.com/library/mac/qa/qa1398/_index.html
"Mach Absolute Time Units"

8 years agoAdd the new Time::HiRes constants to @EXPORT_OK.
Jarkko Hietaniemi [Thu, 14 Jan 2016 00:11:57 +0000 (19:11 -0500)]
Add the new Time::HiRes constants to @EXPORT_OK.

8 years agoAdd FreeBSD specific clock_gettime() constants.
Jarkko Hietaniemi [Wed, 13 Jan 2016 18:06:28 +0000 (13:06 -0500)]
Add FreeBSD specific clock_gettime() constants.

https://www.freebsd.org/cgi/man.cgi?query=clock_gettime

8 years agoAdd Linux-specific clock_gettime() constants.
Jarkko Hietaniemi [Wed, 13 Jan 2016 18:03:07 +0000 (13:03 -0500)]
Add Linux-specific clock_gettime() constants.

http://man7.org/linux/man-pages/man2/clock_gettime.2.html

8 years agoSort the Time::HiRes constants, one per line
Jarkko Hietaniemi [Wed, 13 Jan 2016 18:01:35 +0000 (13:01 -0500)]
Sort the Time::HiRes constants, one per line

8 years agoMake File::Spec::VMS->abs2rel handle Unix-format input.
Craig A. Berry [Sat, 13 Feb 2016 15:47:11 +0000 (09:47 -0600)]
Make File::Spec::VMS->abs2rel handle Unix-format input.

We had been living under the illusion that when passed Unix-format
input, this routine could just punt to File::Spec::Unix-abs2rel.
However, the latter calls canonpath, which returns native specs,
and we ended up mixing native semantics with Unix-format
semantics and got nonsense.

For example, abs2rel('/d1/foo/bar.pl') could become '[bar.pl]'.

So instead we now follow the same basic logic regardless of input
format and there are tests to make sure abs2rel works with both.

8 years agoRemove POSIX isfoo() as scheduled
Karl Williamson [Fri, 12 Feb 2016 03:24:37 +0000 (20:24 -0700)]
Remove POSIX isfoo() as scheduled

The functions like isalnum() have been scheduled for removal in 5.24.
This does that.

8 years agorun regen_perly.pl
David Mitchell [Thu, 11 Feb 2016 17:31:11 +0000 (17:31 +0000)]
run regen_perly.pl

8 years agoregen_perly.pl: improve action extracting
David Mitchell [Wed, 10 Feb 2016 10:53:03 +0000 (10:53 +0000)]
regen_perly.pl: improve action extracting

The regex was sometimes missing final cases from the big
action switch.

This simplifies the regex, but assumes that 'default: break;' is the last
case.  This is the case in bison 2.7 and 3.0.2.

8 years agoregen_perly.pl: print command with -v
David Mitchell [Wed, 10 Feb 2016 10:21:08 +0000 (10:21 +0000)]
regen_perly.pl: print command with -v

when run verbose, print the bison command that is run

8 years agoUpdated outdated link to smoke reports for HP-UX
H.Merijn Brand [Thu, 11 Feb 2016 07:33:40 +0000 (08:33 +0100)]
Updated outdated link to smoke reports for HP-UX

8 years agoregcomp.c: Clarify error message
Karl Williamson [Wed, 10 Feb 2016 22:05:45 +0000 (15:05 -0700)]
regcomp.c: Clarify error message

It is an error to specify an empty Unicode property name, like in
qr/\p{}/.  It also is illegal to just say qr/\p/.  Prior to this commit
the error message for that latter construct misleadingly referred to
braces.  Since there are no braces in the input, they shouldn't be
mentioned.

8 years agot/re/regex_sets.t: Add some tests
Karl Williamson [Wed, 10 Feb 2016 21:25:31 +0000 (14:25 -0700)]
t/re/regex_sets.t: Add some tests

8 years agosv.c: Handle radix being multi-byte and not UTF-8
Karl Williamson [Wed, 10 Feb 2016 21:21:24 +0000 (14:21 -0700)]
sv.c: Handle radix being multi-byte and not UTF-8

While reviewing this code, I realized that the decimal point could
legally be a sequence of characters, not just a single one.  I don't
know of any cases of that happening, but it's easy to handle that
possibility.

8 years agoregexec.c: Skip duplicate work
Karl Williamson [Wed, 10 Feb 2016 21:13:10 +0000 (14:13 -0700)]
regexec.c: Skip duplicate work

By changing the fallthrough of a case of a switch to a goto we can avoid
re-executing the test that was just done.

8 years agoregcomp.c: Replace invalid assertion
Karl Williamson [Wed, 10 Feb 2016 18:28:58 +0000 (11:28 -0700)]
regcomp.c: Replace invalid assertion

A future commit shows that this assertion is not valid.  I don't know
how it can currently be triggered, but fix the code to properly handle
the case.

8 years agoregcomp.c: Avoid a function call in a common case
Karl Williamson [Wed, 10 Feb 2016 18:22:21 +0000 (11:22 -0700)]
regcomp.c: Avoid a function call in a common case

When the regex pattern is in UTF-8, we can avoid calling the function to
convert it to a code point for the common case where it is the same in
UTF-8 as not,  i.e. if the character is ASCII on ASCII platforms (and
additionally any control on EBCDIC)

8 years agoregcomp.c: Add some grouping parens
Karl Williamson [Wed, 10 Feb 2016 18:04:44 +0000 (11:04 -0700)]
regcomp.c: Add some grouping parens

&& has lower precedence than &, but it's better to be clear.

8 years agoutf8.h: Guard some macros against improper calls
Karl Williamson [Wed, 10 Feb 2016 17:54:42 +0000 (10:54 -0700)]
utf8.h: Guard some macros against improper calls

The UTF8_IS_foo() macros have an inconsistent API.  In some, the
parameter is a pointer, and in others it is a byte.  In the former case,
a call of the wrong type will not compile, as it will try to dereference
a non-ptr.  This commit makes the other ones not compile when called
wrongly, by using the technique shown by Lukas Mai (in
9c903d5937fa3682f21b2aece7f6011b6fcb2750) of ORing the argument with a
constant 0, which should get optimized out.

8 years agoregcomp.c, regexec.c: Comments, white-space only
Karl Williamson [Wed, 10 Feb 2016 23:27:07 +0000 (16:27 -0700)]
regcomp.c, regexec.c: Comments, white-space only

8 years agoregcomp.c: Fix some parsing glitches
Karl Williamson [Wed, 10 Feb 2016 23:27:13 +0000 (16:27 -0700)]
regcomp.c: Fix some parsing glitches

I undertook a code review of how regcomp.c parses things in light of the
tickets found by the fuzzer,
https://rt.perl.org/Ticket/Display.html?id=126546.  This commit is the
result of my efforts so far.  I was not planning to push it now, but the
work found a couple of new error messages that should be raised, and
this has to be done before the visible changes code freeze coming up all
too soon.  I will add test cases after that freeze, including if to see
that these changes fix all the observed issues.

The audit was tedious, and may have missed some things.  Several issues
occurred in multiple places.  One is to not advance the parse by
UTF8SKIP appropriately; another is to subtract one byte from the parse
and assume that that is pointing to the beginning of the previous
character (which under UTF-8 it may not).  Another is to assume that
that the pattern is a C string, that there are no interior NULs in it.
I also found unnecessary tests, given that an SV always has a
terminating NUL.

8 years agoregcomp.c: Extract duped code into one fcn
Karl Williamson [Sun, 27 Dec 2015 17:39:02 +0000 (10:39 -0700)]
regcomp.c: Extract duped code into one fcn

This takes code that was duplicated and makes it into a single static
inline function, so that maintenance tasks don't have to be done on both
copies.

8 years agoporting/diag.t: Handle some E<> pod escapes
Karl Williamson [Thu, 11 Feb 2016 03:46:39 +0000 (20:46 -0700)]
porting/diag.t: Handle some E<> pod escapes

These can occur in perldiag, and so must be converted into the character
that the internal message outputs.  This commit causes the major ones of
these to be converted.

8 years agopodcheck.t: Need to translate E<lt> and E<gt>
Karl Williamson [Thu, 11 Feb 2016 03:31:13 +0000 (20:31 -0700)]
podcheck.t: Need to translate E<lt> and E<gt>

These can appear in links, and need to be translated into their correct
character.

8 years agorelease schedule: September 2016 is scheduled
Ricardo Signes [Thu, 11 Feb 2016 02:56:35 +0000 (21:56 -0500)]
release schedule: September 2016 is scheduled

8 years agoadd shortcut around syscalls when file not found in win32_stat
Daniel Dragan [Wed, 10 Feb 2016 20:47:44 +0000 (15:47 -0500)]
add shortcut around syscalls when file not found in win32_stat

win32_stat on success makes ~7 system calls, some from perl, some from CRT,
but on failure, typically file not found, the perl syscalls fails, then the
CRT stat runs, and fails too, so 5 mostly failing system calls are done
for file not found. If the perl syscall says file not found, the
file wont magically come into existence in the next 10-1000 us for the
CRT's syscalls, so skip calling the CRT and the additional syscalls
if the perl didn't find the file. This patch reduces the number of syscalls
from 5 to 1 for file not found for a win32 perl stat. Benchmark and
profiling info is attached to RT ticket for this patch. Note CreateFile on
a dir fails with ERROR_ACCESS_DENIED so in some cases, a failed CreateFile
is still a successful CRT stat() which does things differently so dirs can
be opened.

8 years agoupdate release schedule for beginnings of 5.25
Ricardo Signes [Wed, 10 Feb 2016 16:06:50 +0000 (11:06 -0500)]
update release schedule for beginnings of 5.25

8 years agoPATCH: [perl #8904] Revamp [:posix:] parsing
Karl Williamson [Tue, 9 Feb 2016 18:50:04 +0000 (11:50 -0700)]
PATCH: [perl #8904] Revamp [:posix:] parsing

A problem with bracketed character classes, qr/[foo]/, is that there is
very little structure about them, so almost anything is legal, and so
typos just silently compile into something unintended.  One of the
possible components are posix character classes.  There are 14 of them,
and they have a very restricted structure, which is easy to get slightly
wrong, so that instead of the intended posix class being compiled,
something else silently is created.  This commit causes the regex
compiler to look for slightly misspelled posix character classes and to
raise a warning when found.  It does not change the results of the
compilation.

To do this, it introduces fuzzy parsing into the regex compiler, using
the Damerau-Levenshtein algorithm to find out how many single character
edits it would take to transform the input into one of the 14 classes.
If it is 1 or 2 off, it considers the input to have been intended to be
that class and raises the warning.  If more edits would be needed, it
remains silent.

This is a heuristic, and someone could have made enough typos that this
thinks a class wasn't intended that was.  Conversely it could raise a
warning when no class was intended, though warnings only happen when the
input very closely resembles a posix class of one of the 14 legal ones.
The algorithm can be tweaked if experience indicates it should.  But the
bottom line is that many more cases of unintended results will now be
warned about.

Things like having blanks in the construct and having the '^' before the
colon are recognized as being intended posix classes (given that the
actual names are close to one of the 14), and raise warnings.  Again
this commit does not change what gets compiled.  This found a bug in
autodoc.pl which was fixed a few commits ago.

The [. .] and [= =] POSIX constructs cause perl to croak that they are
unimplemented.  This commit improves the parsing of these two, and fixes
some false positives.  See
http://nntp.perl.org/group/perl.perl5.porters/230975

The new code combines two functions in regcomp.c into one new one.

8 years agoregcomp.c: Fix recursive parsing bug
Karl Williamson [Tue, 9 Feb 2016 21:00:23 +0000 (14:00 -0700)]
regcomp.c: Fix recursive parsing bug

In certain cases, regex compilation will use a substitute input string
when parsing what it thinks is a bracketed character class /[ ... ] /.
The substitute automatically had a ']' appended to it, even if the
original didn't have one, leading to wrong results.

I did not add a test for this, as the next commit causes current tests
to fail if this one isn't done.

8 years agoregcomp.c: White-space, variable name-change only
Karl Williamson [Tue, 9 Feb 2016 18:28:32 +0000 (11:28 -0700)]
regcomp.c: White-space, variable name-change only

This changes indents, and the names of two variables in preparation for
the next commit, so the difference listing won't be so large for that.

8 years agoautodoc.pl: Fix misspelled /[[:alpha:]]/
Karl Williamson [Tue, 9 Feb 2016 18:00:58 +0000 (11:00 -0700)]
autodoc.pl: Fix misspelled /[[:alpha:]]/

This typo was caught by the work for a couple of commits down the road.

8 years agoAdd Nick Logan to AUTHORS
Karl Williamson [Tue, 9 Feb 2016 17:49:29 +0000 (10:49 -0700)]
Add Nick Logan to AUTHORS

The previous commit used code written by him.

8 years agoregcomp.c: Add code to compute edit distance (Damerau–Levenshtein)
Karl Williamson [Tue, 9 Feb 2016 17:40:38 +0000 (10:40 -0700)]
regcomp.c: Add code to compute edit distance (Damerau–Levenshtein)

This will be used in a future commit.

This code is taken from CPAN Text::Levenshtein::Damerau::XS with the
author's knowledge.  There have been white-space changes to make it
conform better to perl's core coding standards, and declaration changes
to make it more portable, such as using UV instead of 'unsigned int',
and PERL_STATIC_INLINE instead of a less portable form, but the logic is
unchanged.  One variable was changed to signed from unsigned to avoid a
warning message from some compilers.

The author and I will decide later about keeping the cpan module and
this code in sync.  It changes very rarely.

8 years agoperldelta for 1bb1a3d6d35
Tony Cook [Wed, 10 Feb 2016 05:07:42 +0000 (16:07 +1100)]
perldelta for 1bb1a3d6d35

8 years ago[perl #127334] S_incline: avoid overrunning the end of the parse buffer
Tony Cook [Wed, 10 Feb 2016 05:03:22 +0000 (16:03 +1100)]
[perl #127334] S_incline: avoid overrunning the end of the parse buffer

If the rest of the allocation up to the end addressable memory was
non-spaces, this loop could cause a segmentation fault.

Avoid that by ensuring we stop when we see a NUL.

8 years agoperldelta for 7db8c4f1f19e and 958cdeac409
Tony Cook [Wed, 10 Feb 2016 03:35:53 +0000 (14:35 +1100)]
perldelta for 7db8c4f1f19e and 958cdeac409

8 years ago[perl #127494] don't cache AUTOLOAD as DESTROY
Tony Cook [Wed, 10 Feb 2016 03:30:08 +0000 (14:30 +1100)]
[perl #127494] don't cache AUTOLOAD as DESTROY

Otherwise S_curse() would need to do all the work gv_autoload_pvn()
already does to set up to call AUTOLOAD() (setting $AUTOLOAD etc.)

Instead, by not caching it, we ensure gv_autoload_pvn() is called
each time to perform the required setup.

This has a performance cost over adding that code to S_curse(), but the
cost of actually running the AUTOLOAD sub is likely to drown that out,
and is easily avoided by adding "sub DESTROY {}" to the module.

8 years ago[perl #127494] TODO test for $AUTOLOAD being set for DESTROY
Tony Cook [Wed, 10 Feb 2016 00:46:48 +0000 (11:46 +1100)]
[perl #127494] TODO test for $AUTOLOAD being set for DESTROY

000814da allowed the cached DESTROY method to be an AUTOLOAD method,
but didn't ensure that $AUTOLOAD (or the equivalent for XS AUTOLOADS)
was set when AUTOLOAD was called.

Add a TODO test for this behaviour.

8 years agoUpdate guidance on naming of modules.
James E Keenan [Sun, 7 Feb 2016 12:58:29 +0000 (07:58 -0500)]
Update guidance on naming of modules.

Delete reference to comp.lang.perl.misc.  Add references to module-authors
list/newsgroup and to PAUSE.

For:  RT # 127435

8 years agoRemove outdated task in release:
Sawyer X [Tue, 9 Feb 2016 18:57:58 +0000 (19:57 +0100)]
Remove outdated task in release:

I checked with Graham Barr, who said the list of PAUSE accounts
that can upload perl distributions is automated and taken from:

    http://pause.perl.org/pause/query?ACTION=who_pumpkin;OF=YAML

This means that if you're already on the list, you do not need
to check again on search.cpan.org or to bug Graham. :)

8 years agoTime::HiRes moved from "cpan" to "dist" in 91ba54
Tom Hukins [Tue, 9 Feb 2016 11:15:53 +0000 (11:15 +0000)]
Time::HiRes moved from "cpan" to "dist" in 91ba54

8 years agolocale.c: Improve -DL debug info
Karl Williamson [Mon, 1 Feb 2016 18:08:29 +0000 (11:08 -0700)]
locale.c: Improve -DL debug info

This changes the debug info to include if the LC_NUMERIC decimal point
(radix) character string is UTF-8 encoded or not, and it uses the actual
value stored in Perl for that string instead of the POSIX origin of that
data, thus being more accurate should they ever get out-of-sync

8 years agomove Time-HiRes from cpan to dist
Ricardo Signes [Mon, 8 Feb 2016 21:20:58 +0000 (16:20 -0500)]
move Time-HiRes from cpan to dist

8 years agoperldelta for 27895dda8085, ac3b837b9e1b, f05081b8ef22, 000814da4770
Tony Cook [Mon, 8 Feb 2016 04:20:40 +0000 (15:20 +1100)]
perldelta for 27895dda8085ac3b837b9e1bf05081b8ef22000814da4770

8 years ago[perl #124387] call AUTOLOAD when DESTROY isn't defined
Tony Cook [Tue, 19 Jan 2016 00:42:21 +0000 (11:42 +1100)]
[perl #124387] call AUTOLOAD when DESTROY isn't defined

8 years ago[perl #124387] TODO test for AUTOLOAD on DESTROY
Tony Cook [Tue, 19 Jan 2016 00:39:48 +0000 (11:39 +1100)]
[perl #124387] TODO test for AUTOLOAD on DESTROY

8 years ago[perl #126410] keep the DESTROY cache in mro_meta
Tony Cook [Mon, 18 Jan 2016 06:42:32 +0000 (17:42 +1100)]
[perl #126410] keep the DESTROY cache in mro_meta

We're already keeping destroy_gen there, so keep the CV there too.

The previous implementation, introduced in 8c34e50d, kept the
destroy method cache in the stash's stash, which broke B's SvSTASH
method.

Before that, the DESTROY method was cached in overload magic.

A previous version of this patch didn't clear the destructor cache on
a clone, which caused ext/XS-APItest/t/clone_with_stack.t to fail.

8 years agoDocument broken SvSTASH for %version:: in B's test suite
Todd Rinaldo [Mon, 18 Jan 2016 05:30:37 +0000 (16:30 +1100)]
Document broken SvSTASH for %version:: in B's test suite

RT 126410: This may not be a B bug but we have no test coverage for SvSTASH at
the moment. TODO the test until it is working correctly.

TonyC: fix syntax error and update MANIFEST

8 years agoperldelta for 071db91b12fc
Tony Cook [Sun, 7 Feb 2016 23:16:50 +0000 (10:16 +1100)]
perldelta for 071db91b12fc

8 years agoadd Pip Cet to AUTHORS
Tony Cook [Sun, 7 Feb 2016 23:02:48 +0000 (10:02 +1100)]
add Pip Cet to AUTHORS

8 years ago[perl #127474] fix operator precedence when (castflags & 2)
Pip Cet [Sun, 7 Feb 2016 23:01:06 +0000 (10:01 +1100)]
[perl #127474] fix operator precedence when (castflags & 2)

8 years agoStorable version bump.
Jarkko Hietaniemi [Fri, 5 Feb 2016 17:00:06 +0000 (12:00 -0500)]
Storable version bump.

8 years agoPOSIX version bump.
Jarkko Hietaniemi [Thu, 4 Feb 2016 01:35:49 +0000 (20:35 -0500)]
POSIX version bump.

8 years agoPOSIX: strcmp NE strEQ().
Jarkko Hietaniemi [Fri, 5 Feb 2016 21:37:58 +0000 (16:37 -0500)]
POSIX: strcmp NE strEQ().

CID 135006: Constant expression result (CONSTANT_EXPRESSION_RESULT)

The Coverity 'detail' is priceless:

always_true_or: The "or" condition strcmp(strings->name, "decimal_point") || strcmp(strings->name, "thousands_sep") || strcmp(strings->name, "grouping") will always be true because strings->name cannot be equal to two different values at the same time, so it must be not equal to at least one of them.

8 years agoPOSIX: Check fds against negatives.
Jarkko Hietaniemi [Thu, 4 Feb 2016 02:40:34 +0000 (21:40 -0500)]
POSIX: Check fds against negatives.

Not directly an open Coverity issue (though previously we have had
similar ones) but inspired by the similar change for signal numbers.

8 years agoPOSIX: Check signal numbers against negatives.
Jarkko Hietaniemi [Thu, 4 Feb 2016 01:06:38 +0000 (20:06 -0500)]
POSIX: Check signal numbers against negatives.

CID 135020: Argument cannot be negative (NEGATIVE_RETURNS)
CID 135021: Argument cannot be negative (NEGATIVE_RETURNS)

sigismember()
sigaddset()
sigdelset()

Note that sigaction() already has its own handling for the signal number.

8 years agoStorable: Own ASSERT or no, we want to assert(prev).
Jarkko Hietaniemi [Thu, 4 Feb 2016 00:40:21 +0000 (19:40 -0500)]
Storable: Own ASSERT or no, we want to assert(prev).

Coverity CID 135012: Explicit null dereferenced (FORWARD_NULL)

The prev can be set to NULL (zero) just few lines earlier.

8 years agoXS-APItest: Length cannot be negative.
Jarkko Hietaniemi [Thu, 4 Feb 2016 02:42:36 +0000 (21:42 -0500)]
XS-APItest: Length cannot be negative.

Coverity CID 135019: Argument cannot be negative (NEGATIVE_RETURNS)

8 years agoODBM_File: Avoid TOCTOU and using negative returns.
Jarkko Hietaniemi [Wed, 3 Feb 2016 15:53:23 +0000 (10:53 -0500)]
ODBM_File: Avoid TOCTOU and using negative returns.

Coverity CID 135022: Argument cannot be negative (NEGATIVE_RETURNS)
Coverity CID 135027: Time of check time of use (TOCTOU)

Replace use of stat()-guarded use of creat() (wow) with open(...O_EXCL...)
(when O_CREAT) so that there is no race condition (TOCTOU) window
between the stat() check for non-existence (which can fail also for
other reasons) and the two (sic) creat() calls.

Similarly, without O_CREAT, use open(...O_RDONLY...) instead of the stat().

Possible problem: arguably, systems old enough to be still using
ODBM_File (or requiring creat()) might not have the O_EXCL.

8 years agoAdd missing break in switch.
Jarkko Hietaniemi [Sun, 7 Feb 2016 00:59:09 +0000 (19:59 -0500)]
Add missing break in switch.

Coverity CID 135145: Missing break in switch (MISSING_BREAK)

8 years agoAdd missing break in switch.
Jarkko Hietaniemi [Sun, 7 Feb 2016 00:55:53 +0000 (19:55 -0500)]
Add missing break in switch.

Coverity CID 28986: Missing break in switch (MISSING_BREAK)

8 years agoassert(PL_parser)
Jarkko Hietaniemi [Sun, 7 Feb 2016 00:50:33 +0000 (19:50 -0500)]
assert(PL_parser)

Coverity CID 135144: Dereference after null check (FORWARD_NULL)

Earlier, pp.c:8254-ish, PL_parser is tested against NULL, so it
presumably can be NULL.

8 years agoAssert no bad array access.
Jarkko Hietaniemi [Sun, 7 Feb 2016 00:28:00 +0000 (19:28 -0500)]
Assert no bad array access.

Coverity CID 135147: Out-of-bounds access (OVERRUN)

Long-distance trouble: regexec.c:8922-ish calls (if DEBUGGING) the
regprop() in regcomp.c, which can access the five-element bounds[]
array with the flags value as the offset.  However, Coverity thinks
it sees that in regexec.c the flags value may be up to nine.

8 years agoDo not try to fchown() to uid -1 and gid -1.
Jarkko Hietaniemi [Sun, 7 Feb 2016 01:21:03 +0000 (20:21 -0500)]
Do not try to fchown() to uid -1 and gid -1.

8 years agoCheck against negative uid/gid for fchown().
Jarkko Hietaniemi [Sun, 7 Feb 2016 00:05:10 +0000 (19:05 -0500)]
Check against negative uid/gid for fchown().

Coverity CID 135145: Argument cannot be negative (NEGATIVE_RETURNS)

8 years agoassert(cv) before doing CvROOT(cv)
Jarkko Hietaniemi [Sat, 6 Feb 2016 23:54:29 +0000 (18:54 -0500)]
assert(cv) before doing CvROOT(cv)

Coverity CID 29020 (an old one from 2014, wondering why it now resurfaced)

8 years agoCheck for invlist_search() returning negative array indices.
Jarkko Hietaniemi [Wed, 3 Feb 2016 21:33:20 +0000 (16:33 -0500)]
Check for invlist_search() returning negative array indices.

Coverity CID 135014: Negative array index read (NEGATIVE_RETURNS)
Coverity CID 135015: Negative array index read (NEGATIVE_RETURNS)

Multiple cases, all the getLB_...() uses in regexec.c.

Address this by under DEBUGGING rerouting the invlist_search()
result through a static helper function which does the sanity
checking against negatives and then returns the result.

8 years agoIf not using smallbuf and len > sizeof(d_name), Move() is illegal.
Jarkko Hietaniemi [Wed, 3 Feb 2016 14:53:54 +0000 (09:53 -0500)]
If not using smallbuf and len > sizeof(d_name), Move() is illegal.

Coverity CID 135024: Out-of-bounds access (OVERRUN)

If the len is not <= sizeof(smallbuf), the len is at least
sizeof(smallbuf) + 1, which means at least 257.  Now, if the
sizeof(dirent->d_name) is < 257, the Move() would access bytes
beyond the end of d_name[].  Yes, this would need for the d_namlen
(for example) to be out of sync with d_name[].  But paranoia is good.

Because of the severity of the problem (indicating serious mess),
returning NULL instead of partial result is probably better.

Possible portability problem: can d_name ever be not an array,
but instead a bare char pointer?  If that can happen, the sizeof(d_name)
is wrong, and in that case we have to have some other way of figuring
out the maximum size for a directory entry name.

The smallbuf probably could/should be of size MAXPATHLEN.

8 years agoWhitespace only: zap empty lines.
Jarkko Hietaniemi [Fri, 5 Feb 2016 23:48:02 +0000 (18:48 -0500)]
Whitespace only: zap empty lines.

8 years agoLexical scoping in case statement is tricky.
Jarkko Hietaniemi [Fri, 5 Feb 2016 21:06:53 +0000 (16:06 -0500)]
Lexical scoping in case statement is tricky.

Coverity CID 135142: Structurally dead code (UNREACHABLE)

The case labels are just effectively goto labels, and therefore
any variable initialization will not happen.  That is not the case
luckily here, the variables will be always overwritten as needed.
But better not to introduce false lexical scopes to avoid future
misery.

In the general case, the only way to have lexically tighter scopes is
to have dedicated blocks for each case, but that doesn't easily work here,
with all the tricky jumping.

We could switch() the second time on CxTYPE(), and have these variables
scoped on an inner block, but since this is hot hot hot code, better
not to mess with that, and just hoist the variables to an outer scope.
Any deeper refactoring should be done with profilers at hand.

8 years agoassert() that itersvp is non-NULL.
Jarkko Hietaniemi [Wed, 3 Feb 2016 13:11:14 +0000 (08:11 -0500)]
assert() that itersvp is non-NULL.

Coverity CID 135011 Explicit null derefenced

In pp_iter() there are multiple derefers of *itersvp, but at the
setting of itersvp the CxITERVAR() can return NULL, add an assert()
to catch the badness in debug builds (as the Coverity builds are).

8 years agopp_enter: calculate gimme earlier in XS branch
David Mitchell [Sat, 6 Feb 2016 11:04:45 +0000 (11:04 +0000)]
pp_enter: calculate gimme earlier in XS branch

My commit 801bbf618dc make it so that pp_entersub only calculates
gimme at the point its needed, to avoid wasting register resource.
However in n the XS branch it was a bit over-enthusiatic: its possible
for an XS sub to save PL_op and change its value. The old value will
only get restored when pp_entersub soes LEAVE, which is *after* we
cacluate gimme. So grab the value before the XS sub is called.

8 years agoperldelta: recent %ENV changes on VMS.
Craig A. Berry [Sat, 6 Feb 2016 02:29:20 +0000 (20:29 -0600)]
perldelta: recent %ENV changes on VMS.

8 years agoperldelta for podlators update.
Craig A. Berry [Sat, 6 Feb 2016 00:26:06 +0000 (18:26 -0600)]
perldelta for podlators update.

8 years agoIntegrate podlators 4.06.
Craig A. Berry [Fri, 5 Feb 2016 19:24:20 +0000 (13:24 -0600)]
Integrate podlators 4.06.

8 years agocmpVERSION STDERR messages for test failures.
Jarkko Hietaniemi [Fri, 5 Feb 2016 16:35:20 +0000 (11:35 -0500)]
cmpVERSION STDERR messages for test failures.

Better known as t/porting/cmp_version

8 years agoDo environ key case consistently on VMS.
Craig A. Berry [Thu, 4 Feb 2016 22:26:05 +0000 (16:26 -0600)]
Do environ key case consistently on VMS.

For those %ENV elements based on the CRTL environ array, we've
always preserved case when setting them but done look-ups only
after upcasing the key first, which makes lower- or mixed-case
entries go missing.

So make them consistently case-preserved and in the docs
distinguish this behavior from the case-blind behavior of keys
for %ENV entries based on logical namees and DCL symbols, which
remains unchanged.

8 years agoCast away Solaris Studio 12.3 warning.
Jarkko Hietaniemi [Thu, 4 Feb 2016 14:54:53 +0000 (09:54 -0500)]
Cast away Solaris Studio 12.3 warning.

"pp.c", line 3220: warning: initializer will be sign-extended: -2147483648

8 years agoOpenBSD does not do si_uid with sigaction().
Jarkko Hietaniemi [Thu, 4 Feb 2016 12:38:56 +0000 (07:38 -0500)]
OpenBSD does not do si_uid with sigaction().

Seen in OpenBSD 4.8, but found no mention of this working in 5.x.

8 years agoperldelta the fix for [perl #126621]
Tony Cook [Thu, 4 Feb 2016 06:12:23 +0000 (17:12 +1100)]
perldelta the fix for [perl #126621]

which was in 2e2d7405a2b751f778ee3118a87a5f31233efc77

8 years agoPOSIX version bump.
Jarkko Hietaniemi [Thu, 4 Feb 2016 01:18:23 +0000 (20:18 -0500)]
POSIX version bump.

8 years agoWe're against contractions.
Jarkko Hietaniemi [Thu, 4 Feb 2016 01:16:39 +0000 (20:16 -0500)]
We're against contractions.

More importantly: that apostrophe messed up my Emacs' syntax highlighting.

8 years agoOddly placed unused decls for fma() and the gamma funcs.
Jarkko Hietaniemi [Thu, 4 Feb 2016 01:15:21 +0000 (20:15 -0500)]
Oddly placed unused decls for fma() and the gamma funcs.

The fma() also missing not_here().

8 years agoperldelta, perlguts: Fix typos
Karl Williamson [Wed, 3 Feb 2016 23:06:13 +0000 (16:06 -0700)]
perldelta, perlguts: Fix typos