This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Jarkko Hietaniemi [Sun, 13 Mar 2016 23:53:17 +0000 (19:53 -0400)]
Time-HiRes: MUTEX_LOCK, not PERL_MUTEX_LOCK
Ricardo Signes [Sun, 13 Mar 2016 22:47:18 +0000 (18:47 -0400)]
autouse: update tests to match new v1.11 CPAN release
Jarkko Hietaniemi [Sun, 13 Mar 2016 21:26:06 +0000 (17:26 -0400)]
Time-HiRes: aim for CPAN release of 1.9731 today
Yves Orton [Sun, 13 Mar 2016 17:43:31 +0000 (18:43 +0100)]
dont call re_printf() with %*s if you arent going to pass it in
Yves Orton [Sun, 13 Mar 2016 17:12:29 +0000 (18:12 +0100)]
once more for the win
Apparently I have to pass in the context explicitly for this type of
sub, since we cant do a proper macro wrap for subs using ... (va_args/va_list)
so we have to do everything explicitly. Hopefully this fixes the smoke reports
Karl Williamson [Sun, 13 Mar 2016 16:08:36 +0000 (10:08 -0600)]
lib/warnings.t: Skip an ASCII-centric test on EBCDIC
This test is for a specific UTF-8 malformation, but UTF-EBCDIC is
different, so just skip it there.
Yves Orton [Sun, 13 Mar 2016 15:59:32 +0000 (16:59 +0100)]
fixup definitions and usage of new re debugging subs
this should fix the smoke failures on threaded builds,
also it renames re_indentfo which was a terrible name in the first
place, and now what i have had to strip the Perl_prefixes from
these subs with a perl -i -pe, I took the opportunity to rename
it to re_exec_indent, which self documents much better.
Yves Orton [Sun, 13 Mar 2016 10:15:30 +0000 (11:15 +0100)]
[perl #126182] rework pattern GOSUB infinite recursion detection
In
ba6840fbf2fdde3e7f1bda1a26f46c901f36d5ec I tried to fix
[perl #126182] which is a bug about us failing to detect regex
left recursion in some cases.
There were two problems with that patch, both pointed out by
Zefram. The first is that I made left recursion a match fail,
instead of throwing an exception, this makes left-recursion match
sometimes, but at least sometimes in what is arguably the wrong
way. Zefram was able to convince me that dying is better than
matching incorrectly.
The second patch was that it ignored some subtleties in how
the backtracking stack works, which affected how the patch
restored the recurse_locinput[] data which is used to track
what position a GOSUB was entered from. This meant that in
various cases it would not be restored correctly, and we would
still infinite recurse. I believe that it works correctly now.
Thanks for Zefram for the feedback on the original patch.
Yves Orton [Fri, 11 Mar 2016 09:36:25 +0000 (10:36 +0100)]
Rework diagnostics in the regex engine
This introduces three new subs:
Perl_re_printf() which is a wrapper for
PerlIO_printf( Perl_debug_log, ... ),
which cuts down on clutter in the code. Arguably this could be moved
to util.c and renamed something like PerlIO_debugf() and then we could
declutter all the statements that write to the Perl_debug_log
filehandle. But that is a bit too ambituous for me right now, so
I leave this as a regex engine only sub for now.
Perl_re_indentf() which is a wrapper for PerlIO_re_printf(),
which adds an indent argument and automatically indents the
line appropriately, and is used in regcomp.c for trace diagnostics
during compilation.
Perl_re_indentfo() which is similar to Perl_re_indentf() but
is used in regexec.c which adds a specific prefix to each indented
line to account for the fact that during execution we normally have
string position information on the left.
The end result of this patch is that a lot of clutter in the debugging
statements in the regex engine is reduced, exposing what is actually
going on. It should also now be easier to add new diagnostics which
"do the right thing".
Over time the debugging trace output in regexec has become
very cluttered and confusing. This patch cleans much of it up,
if something happens at a given recursion depth it is output
at the right depth, etc, and formats have been changed to not have
leading spaces so you can actually see the indentation properly.
Jarkko Hietaniemi [Sun, 13 Mar 2016 00:57:24 +0000 (19:57 -0500)]
Time-HiRes: record recent changes
Jarkko Hietaniemi [Sun, 13 Mar 2016 00:17:20 +0000 (19:17 -0500)]
Time-HiRes: not_used is unused
Jarkko Hietaniemi [Sun, 13 Mar 2016 00:15:24 +0000 (19:15 -0500)]
Time-HiRes: no mutex for you due to mistyped USE
Jarkko Hietaniemi [Sun, 13 Mar 2016 00:07:54 +0000 (19:07 -0500)]
Time-HiRes: remove unused hrt_ualarm
Binary compat with 1.91 would mean roughly 2006-10, which means
either Perl 5.8.8 or 5.9.5. Time to let go. No hits in CPAN,
as observed by Tony Cook: http://grep.cpan.me/?q=hrt_ualarm
Lukas Mai [Sat, 12 Mar 2016 22:54:31 +0000 (23:54 +0100)]
op.c: cosmetic comment changes
Karl Williamson [Sat, 12 Mar 2016 22:00:45 +0000 (15:00 -0700)]
t/re/uniprops.t: Remove wrong test cases
mktables generates the file used in this test. Unicode version 9
introduces a numeric value that is an order of magnitude closer to 0
than any previous version had. This demonstrated a bug in mktables,
where it didn't consider the possibility of floating point numbers being
indistinguishably close to integers. It did check for being too close
to the rational numbers used in Unicode, but omitted checking for
integers. This adds that check, which in turn causes some wrong test
cases to not be generated for this .t.
This bug has not shown up in earlier Unicode versions, but is there
nonetheless, so I'm pushing this now instead of waiting.
David Mitchell [Sat, 12 Mar 2016 11:09:06 +0000 (11:09 +0000)]
APItest.xs silence compiler warning
On Solaris:
"APItest.xs", line 1519: warning: integer overflow detected: op "<<"
David Mitchell [Sat, 12 Mar 2016 09:39:41 +0000 (09:39 +0000)]
regex sets: fix Solaris optimiser bug
[perl #127455]
On Solaris with -DDEBUGGING, re/regex_sets.t was failing to compile.
This appears to be due to an optimiser bug.
The code in question looked like:
handle_operand:
top_index = av_tindex_nomg(stack);
if (top_index - fence >= 0) {
...
}
printf()ing the value of fence after the av_tindex_nomg() showed that its
value was corrupted (compared with its expected value based on a different
platform with the same debugging print). However, putting a another printf
prior to the av_tindex_nomg() call not only displayed the correct value,
but caused the later printf() to also display the correct value. It seems
that merely accessing fence prior to av_tindex_nomg() avoids the
corruption.
Simplifying the av_tindex_nomg(), the bad behaviour could be reduced to:
if (!stack) { __assert( "" , "", 1); }
Putting a printf after this gave a corrupted fence; a printf before
made everything work.
So this workaround commit just makes sure that fence is accessed prior to
calling av_tindex_nomg().
Andy Broad [Sat, 12 Mar 2016 01:20:31 +0000 (20:20 -0500)]
amigaos4: better popen() + pclose() implementation
popen(): handle better the case where the popened external
might exit before the child process manages to start.
pclose(): protect with a semaphore.
Karl Williamson [Fri, 11 Mar 2016 21:43:33 +0000 (14:43 -0700)]
Fix various pod errors.
Mostly these are too long verbatim lines.
Karl Williamson [Fri, 11 Mar 2016 16:56:48 +0000 (09:56 -0700)]
inline.h: Fix comment
Karl Williamson [Fri, 11 Mar 2016 16:55:55 +0000 (09:55 -0700)]
perlvar: Add a couple links
Karl Williamson [Fri, 11 Mar 2016 16:54:51 +0000 (09:54 -0700)]
perllocale: Nits, update for 5.24 changes
Karl Williamson [Fri, 11 Mar 2016 03:14:24 +0000 (20:14 -0700)]
perlapi: Clarify Latin1 and ISO-8859-1
Steve Hay [Tue, 16 Feb 2016 13:40:08 +0000 (13:40 +0000)]
Export Winsock error constants from POSIX.pm
Steve Hay [Tue, 16 Feb 2016 08:50:08 +0000 (08:50 +0000)]
Export Winsock error constants from Errno.pm
Steve Hay [Thu, 4 Feb 2016 08:51:21 +0000 (08:51 +0000)]
Set $^E for socket errors on Windows
Jarkko Hietaniemi [Fri, 11 Mar 2016 11:57:56 +0000 (06:57 -0500)]
Better wording.
Jarkko Hietaniemi [Fri, 11 Mar 2016 01:07:35 +0000 (20:07 -0500)]
gitignore for cscope index files.
Jarkko Hietaniemi [Fri, 11 Mar 2016 01:05:32 +0000 (20:05 -0500)]
make target for cscope indexing.
Ricardo Signes [Fri, 11 Mar 2016 00:10:16 +0000 (19:10 -0500)]
CPAN release of autouse is now 1.10
this has no changes to code from 1.08; it gets in the test changes
from blead and adds a prereq for Scalar::Util with isdual
Karl Williamson [Thu, 10 Mar 2016 22:52:34 +0000 (15:52 -0700)]
perlapi: Document ninstr() and rninstr()
Karl Williamson [Thu, 10 Mar 2016 19:10:38 +0000 (12:10 -0700)]
t/re/reg_mesg.t: Add some more tests
Yves Orton [Wed, 9 Mar 2016 19:03:21 +0000 (20:03 +0100)]
use inequality when checking "tail" in trie compilation
It is possible that a node inside an alternation points out
and past the end of the alternation, using equality on tail
means we don't notice. Its not clear that this is actually
required, but it has been an issue in other contexts so lets
just always use inequalities for this purpose.
Yves Orton [Wed, 9 Mar 2016 19:00:53 +0000 (20:00 +0100)]
Fix Perl #126206: handle NOTHING regops and EXACTFU_SS regops in make_trie() properly
... and avoid dereffing non-EXACT nodes unnecessarily at the same
time. This fixes https://rt.perl.org/Ticket/Display.html?id=126206
Karl Williamson [Wed, 9 Mar 2016 01:39:46 +0000 (18:39 -0700)]
utf8.c: Add missing {}
which caused an if's scope to be less than intended.
Spotted by Jarkko Hietaniemi using gcc 6 with the
'-Wmisleading-indentation' option
Tony Cook [Wed, 9 Mar 2016 01:02:50 +0000 (12:02 +1100)]
perldelta for
c2538af7458
Tony Cook [Wed, 9 Mar 2016 00:54:13 +0000 (11:54 +1100)]
[perl #122287] probe in Configure whether dtrace builds an object
When building the object file, newer versions of dtrace (on Illumos
based systems at least) require an input object file that uses
at least one of the probes defined in the .d file.
The test in Makefile.SH didn't provide that definition so the test
would fail, and not build an object file, and fail to link later on,
on systems that *do* need the object file.
Moved the probe to Configure (where it probably belongs) and supplied
an object file that uses a probe.
Tested successfully on OmniOS (with the new dtrace), Solaris 11,
and darwin.
Tony Cook [Tue, 8 Mar 2016 23:43:57 +0000 (10:43 +1100)]
fix a skip count in cpan/IPC-SysV/t/ipcsysv.t
reported upstream as https://rt.cpan.org/Ticket/Display.html?id=112827
Tony Cook [Tue, 1 Mar 2016 00:35:21 +0000 (11:35 +1100)]
[perl #127533] only test semctl() if we have everything needed to use it
In a FreeBSD jail, the semctl() entry point might exist, but can be
disabled by policy, when it is disabled, the Configure code that
tests for the different structures that can be supplied to semctl()
fail.
The code that implements semctl() for perl treats semctl() as
unimplemented if neither structure is available, so avoid testing
semctl() if the structures couldn't be detected.
Karl Williamson [Tue, 8 Mar 2016 04:37:00 +0000 (21:37 -0700)]
perlvar: Cross reference other pods
Suggested by "kes" in
http://nntp.perl.org/group/perl.perl5.porters/234447
Karl Williamson [Mon, 7 Mar 2016 21:49:54 +0000 (14:49 -0700)]
Convert to use av_tindex_nomg()
I looked at the code I'm familiar with, and converted the av_tindex
calls on arrays I was confident don't have magic to av_tindex_nomg().
This saves a little work each time.
Karl Williamson [Mon, 7 Mar 2016 21:44:50 +0000 (14:44 -0700)]
Add av_tindex_nomg()
This is like av_tindex, but doesn't handle magic. I'm not documenting
it for now, in case it turns out this was not a good idea.
Inspired from an observation by Tony Cook.
Karl Williamson [Tue, 8 Mar 2016 00:02:04 +0000 (17:02 -0700)]
regcomp.c: Silence some compiler warnings
Some compilers wrongly think these variables can be used uninitialized.
Karl Williamson [Mon, 7 Mar 2016 22:50:41 +0000 (15:50 -0700)]
perlguts: Slight clarification
Karl Williamson [Mon, 7 Mar 2016 22:45:35 +0000 (15:45 -0700)]
perlapi: Slight clarification
This changes to use 'transfer' to make clear that the reference count is
unchanged. Some think that the previous wording 'take' is good as-is;
some agree with me. Daniel Dragan has pointed out that 5 years ago I
changed this line, while retaining 'take'. Given that 'transfer' is
unambiguous to all, while 'take' is ambiguous to some, I'm making the
change.
Karl Williamson [Mon, 7 Mar 2016 18:17:39 +0000 (11:17 -0700)]
pod/perldelta: Add some Selected Bug Fixes
Karl Williamson [Mon, 7 Mar 2016 21:19:42 +0000 (14:19 -0700)]
regcomp.c: Remove redundant assignment
The assignment removed here is followed immediately by a goto, and the
target of the goto repeats the assignment, so this one is redundant.
Spotted by Tony Cook
Karl Williamson [Mon, 7 Mar 2016 17:41:22 +0000 (10:41 -0700)]
perlre: Nits, clarifications
David Mitchell [Mon, 7 Mar 2016 15:18:07 +0000 (15:18 +0000)]
S_study_chunk(): silence compiler warning
Jarkko Hietaniemi [Mon, 7 Mar 2016 11:48:23 +0000 (06:48 -0500)]
Mention bytes::length modern workaround re
01e331e5
Also add an emboldening and parabreak to underline the discouragement.
Jarkko Hietaniemi [Mon, 7 Mar 2016 02:23:50 +0000 (21:23 -0500)]
Make open failures little less cryptic.
Yves Orton [Mon, 7 Mar 2016 08:18:33 +0000 (09:18 +0100)]
add comment explaining a subtlety
Tony caught a bug I made in
d5a00e4af6b155495be31a35728b8fef8e671ebe and fixed
it in
2dc40b2d7c20b0d31c4343ac23cda9799f234a65. This comment explains
the subtlety that lead to the bug: the compilation state var
RExC_npar is +1 as compared to the equivalent rex->nparens.
Karl Williamson [Mon, 7 Mar 2016 05:44:09 +0000 (22:44 -0700)]
Add test for [perl #126405]
Commit
b297756b5d78ef23f3ebf878d0342947ece424aa did not add a test, but
such a test is possible, and is added here. The problem only showed up
on some configurations, but nonetheless, it did show up, and so will
fail the added test on those configurations, which turn out to be
regularly smoked.
Shlomi Fish [Sun, 6 Mar 2016 18:52:03 +0000 (20:52 +0200)]
Document the previous commit in Carp's Changes.
Shlomi Fish [Sun, 6 Mar 2016 18:37:25 +0000 (20:37 +0200)]
Fix RTCPAN#107225 : longmess returns 1 on ref.
See: https://rt.cpan.org/Public/Bug/Display.html?id=107225 . Also
discovered as a bug in perl -d by me (= Shlomi Fish) and reported
after the original report. longmess() returns "1" when called in scalar
context if passed a reference.
Tony Cook [Mon, 7 Mar 2016 03:58:38 +0000 (14:58 +1100)]
avoid reading/writing beyond the end of RExC_(open|close)_parens
Partly reverts
d5a00e4af, which added this change:
- for ( paren=0 ; paren < RExC_npar ; paren++ ) {
+ for ( paren=0 ; paren <= RExC_npar ; paren++ ) {
but RExC_(open|close)_parens are both allocated with RExC_npar entries,
making this a read/write buffer overflow.
This caused crashes during the build with GCC on Win32, and was
detectable with valgrind and -fsanitize=address on Linux.
With the change, passes all tests with -fsanitize=address -DDEBUGGING
on Linux and finishes the build with GCC on Win32.
Tony Cook [Mon, 7 Mar 2016 00:43:51 +0000 (11:43 +1100)]
Lukas Mai [Thu, 3 Mar 2016 23:21:27 +0000 (00:21 +0100)]
make building without memcpy work (RT #127619)
Lukas Mai [Mon, 29 Feb 2016 07:45:12 +0000 (08:45 +0100)]
util.c: make my_mem*/my_b* prototypes more like the originals
Karl Williamson [Mon, 10 Aug 2015 03:40:21 +0000 (21:40 -0600)]
Update bytes.pm doc
The one legitimate use of this pragma is for debugging. This changes to
say so, and other minor changes.
Yves Orton [Sun, 6 Mar 2016 16:32:35 +0000 (17:32 +0100)]
regcomp.c: fix Perl #126405, segfault regex
There was a flaw in how we scan regexes for triable sequences.
It is possible that the end of a branch points *past* the tail of
the branch sequences, which was resulting in us constructing
tries when we shouldn't. This patch changes equivalency tests for
an inequality test, which prevents this problem.
I am not sure how to test for this problem as it doesn't actually
segfault for me, but I can see the illegal read in valgrind.
Yves Orton [Sun, 6 Mar 2016 16:31:14 +0000 (17:31 +0100)]
regcomp.c: improve diagnostics for TRIE construction
Yves Orton [Sun, 6 Mar 2016 12:56:44 +0000 (13:56 +0100)]
fix Perl #126182, out of memory due to infinite pattern recursion
The way we tracked if pattern recursion was infinite did not work
properly. A pattern like
"a"=~/(.(?2))((?<=(?=(?1)).))/
would loop forever, slowly eat up all available ram as it added
pattern recursion stack frames.
This patch changes the rules for recursion so that recursively
entering a given pattern "subroutine" twice from the same position
fails the match. This means that where previously we might have
seen fatal exception we will now simply fail. This means that
"aaabbb"=~/a(?R)?b/
succeeds with $& equal to "aaabbb".
Yves Orton [Sat, 5 Mar 2016 21:04:28 +0000 (22:04 +0100)]
Unify GOSTART and GOSUB
GOSTART is a special case of GOSUB, we can remove a lot of offset twiddling,
and other special casing by unifying them, at pretty much no cost.
GOSUB has 2 arguments, ARG() and ARG2L(), which are interpreted as
a U32 and an I32 respectively. ARG() holds the "parno" we will recurse
into. ARG2L() holds a signed offset to the relevant start node for the
recursion.
Prior to this patch the argument to GOSUB would always be >=, and unlike
other parts of our logic we would not use 0 to represent "start/end" of
pattern, as GOSTART would be used for "recurse to beginning of pattern",
after this patch we use 0 to represent "start/end", and a lot of
complexity "goes away" along with GOSTART regops.
Yves Orton [Sat, 5 Mar 2016 22:09:19 +0000 (23:09 +0100)]
rename RExC_opend RExC_end_op for clarity
Yves Orton [Sat, 5 Mar 2016 19:40:36 +0000 (20:40 +0100)]
first step cleaning up regexp recursion "return" logic
When we do a GOSUB/GOSTART we need to know where the recursion
"returns" to the previous position in the pattern. Currently
this is done by comparing cur_eval->u.eval.close_paren to the
the argument of CLOSE parens, and within END blocks (for GOSTART).
However, there is a problem. The state machinery for GOSUB/GOSTART
is shared with EVAL ( implementing /(??{ ... })/ ), which also sets
cur_eval->u.eval.close_paren to 0. This for instance breaks /(?(R)YES|NO)/
by making it return true within a /(??{ ... })/ when arguably it
shouldn't. It also is confusing.
So we change the meaning of close_paren so that 0 means "from EVAL",
and that otherwise the value is "+1", so 1 means GOSTART (trigger for
END), and 2 means "CLOSE1", etc. In order to make this transparent
this patch adds the EVAL_CLOSE_PAREN_IS( cur_eval, EXPR ) macro which
does the right thing:
( cur_eval && cur_eval->u.eval.close_paren &&
( ( cur_eval->u.eval.close_paren - 1 ) == EXPR ) )
Karl Williamson [Sun, 6 Mar 2016 03:22:44 +0000 (20:22 -0700)]
perlebcdic: Update for 5.24
Fix some typos, and most importantly remove the now-fixed items from the
BUGS section
Jarkko Hietaniemi [Sat, 5 Mar 2016 21:34:31 +0000 (16:34 -0500)]
Time-HiRes: record latest changes
Assuming that at some point a CPAN release of the new! shinier!
Time-HiRes might be a good thing.
The version bump to 1.9731 was done already in
1625f1d3. Leave the
day of month open in case more changes come in, no need to constantly
bump the version.
Ricardo Signes [Sat, 5 Mar 2016 19:22:30 +0000 (14:22 -0500)]
PathTools: import Changes file from CPAN
Andy Broad [Sat, 5 Mar 2016 18:18:08 +0000 (13:18 -0500)]
amigaos4: execvp() and popen() enhancements
myexecvp()
Replaces alloca() in execvp() with IExec->AllocVecTags() with the memory
type explicitly set to MEMF_SHARED (alloca allocating on the stack which is
MEMF_PRIVATE and in theory at least you can't share that with the sub
process (in practice this isn't enforced yet, too much old software would
break, but one of these days)).
amigaos_popen()
Alters file opening order to ensure that the write end of the pipe is always
opened first.
Now attempts to pass Input() out Output() (stdin or stout) to the non-pipe
file handles rather than NIL: reverting to NIL: if the above can't be
DupFileHandled() (say if they were redirected to a file opened with an
exclusive lock).
Karl Williamson [Sat, 5 Mar 2016 00:05:09 +0000 (17:05 -0700)]
PATCH: [perl #127262] assertion fail on malformed UTF8
Add a guard against malformed UTF-8.
Jarkko Hietaniemi [Fri, 4 Mar 2016 02:20:55 +0000 (21:20 -0500)]
Time-HiRes: refactor also nanosleep init
Jarkko Hietaniemi [Fri, 4 Mar 2016 02:11:38 +0000 (21:11 -0500)]
Time-HiRes: avoid going negative on struct timespec
Jarkko Hietaniemi [Fri, 4 Mar 2016 02:25:30 +0000 (21:25 -0500)]
Time-HiRes: refactor common timespec subtraction code
Jarkko Hietaniemi [Thu, 3 Mar 2016 23:23:52 +0000 (18:23 -0500)]
Time-HiRes: for nanosleeps, zero is success
Testing for zero makes it slightly less odd-looking than bang.
Jarkko Hietaniemi [Thu, 3 Mar 2016 23:21:42 +0000 (18:21 -0500)]
Time-HiRes: use NV_1E6 and NV_1E9 consistently
Jarkko Hietaniemi [Thu, 3 Mar 2016 22:29:58 +0000 (17:29 -0500)]
Time-HiRes: initialize the unslept timespec
Found by clang scan-build.
David Mitchell [Fri, 4 Mar 2016 17:36:57 +0000 (17:36 +0000)]
threads.xs: create new static fn S_jmpenv_run()
S_jmpenv_run() replaces 3 similar pieces of code that do
JMPENV_PUSH(); ... stuff ...; JMPENV_POP().
As a side effect of this commit, it gets rid of this annoying warning
under g++:
warning: variable ‘my_perl’ might be clobbered by ‘longjmp’
David Mitchell [Fri, 4 Mar 2016 10:59:21 +0000 (10:59 +0000)]
rpeep(): eliminate compiler warning
op.c: In function ‘Perl_rpeep’:
op.c:13692:37: warning: comparison is always false due to limited
range of data type [-Wtype-limits]
? base : 0) >
^
replace the '0' with something that still always fails to match but
hopefully won't warn.
David Mitchell [Thu, 3 Mar 2016 10:59:57 +0000 (10:59 +0000)]
Simplify _MEM_WRAP_NEEDS_RUNTIME_CHECK()
And at the same time hopefully avoid some false-positive compiler warnings
on HP-UX
Karl Williamson [Fri, 4 Mar 2016 20:14:30 +0000 (13:14 -0700)]
PATCH: [perl #126141]: qr/]]]]][\\/ fails to raise error
This was due to the trailing \ trying to look at the next character
without verifying that one actually existed.
Karl Williamson [Fri, 4 Mar 2016 18:59:18 +0000 (11:59 -0700)]
regcomp.c: Fix a memory leak
This revises
5751998882d1db1c0f62a32a0b16e58176928a35 so that it works
if a called function fails to return (it was failing if there was
illegal tainting going on).
Karl Williamson [Fri, 4 Mar 2016 17:12:43 +0000 (10:12 -0700)]
locale.c: Avoid a leak
This reorders things to allow a free to be done. The cause was spotted
by Tony Cook.
Karl Williamson [Fri, 4 Mar 2016 16:34:40 +0000 (09:34 -0700)]
POSIX.xs: Avoid a leak in setlocale()
Tony Cook suggested this fix.
Karl Williamson [Mon, 22 Feb 2016 18:27:50 +0000 (11:27 -0700)]
TODO or skip certain failing locale tests on cygwin
This is a known problem which cygwin has fixed in 2.5
Tony Cook tested this and found and fixed several bugs in it before this
final version was made.
Karl Williamson [Thu, 3 Mar 2016 21:21:05 +0000 (14:21 -0700)]
regcomp.c: Revise, add comments, white-space changes
Karl Williamson [Thu, 3 Mar 2016 16:56:41 +0000 (09:56 -0700)]
regcomp.c: Avoid a memory leak
The croak is using heap storage for an argument. Making that
SAVEFREEPV() will make sure it gets freed.
Karl Williamson [Thu, 3 Mar 2016 16:40:55 +0000 (09:40 -0700)]
regcomp.c: White-space only
Outdent and reflow comments because the previous commit removed a
surrounding block.
Karl Williamson [Thu, 3 Mar 2016 05:10:58 +0000 (22:10 -0700)]
Reinstate "PATCH: {perl #127582] Over eager warning for /[.foo.]/""
This reverts commit
ab9a4aa72166b26d6c3556107c19ba08ee956a88 which
itself reverted commit
a9149dfda17b511d34bb2af869948b677be52fbc, thus
reinstating the original. But this new commit also adds a check to
avoid going off the end of a buffer, the absence of which was the cause
for the failure of the original commit with address sanitizer.
Karl Williamson [Thu, 3 Mar 2016 16:14:13 +0000 (09:14 -0700)]
locale.c: Silence HP-UX compiler warning
Cast this flag value to a bool, which is what we want anyway here.
Jarkko Hietaniemi [Thu, 3 Mar 2016 14:01:05 +0000 (09:01 -0500)]
Warn of the "else syndrome".
Not that anyone ever reads perlport.
Jarkko Hietaniemi [Thu, 3 Mar 2016 13:57:32 +0000 (08:57 -0500)]
Clarify what AmigaOS version was broken by 5.8.0
Jarkko Hietaniemi [Thu, 3 Mar 2016 01:11:23 +0000 (20:11 -0500)]
perl5db.pl version bump
Jarkko Hietaniemi [Wed, 2 Mar 2016 23:49:18 +0000 (18:49 -0500)]
Defaulting to VMS is probably not right.
Andy Broad [Wed, 2 Mar 2016 23:45:52 +0000 (18:45 -0500)]
amigaos4: use CONSOLE:, not VMS sys$command
Andy Broad [Wed, 2 Mar 2016 23:43:44 +0000 (18:43 -0500)]
amigaos4: clean up older style / deprecated AmigaOS calls
Tony Cook [Wed, 2 Mar 2016 05:19:43 +0000 (16:19 +1100)]
reduce number of calls to add_cp_to_invlist()
Both S_get_ANYOF_cp_list_for_ssc() and S_put_charclass_bitmap_innards()
have tight loops that iterate over a bitmap and calls add_cp_to_invlist()
for each bit set.
add_cp_to_invlist() is a fairly wrapper around _add_range_to_invlist()
which create a new invlist to hold the range and then calls
_invlist_union() to perform the add. This is moderately expensive.
Instead of indirectly calling _add_range_to_invlist(), where it's
simple to do so, instead look for ranges of bits set in the bitmaps
and call _add_range_to_invlist() directly.
This changed the cachegrind output from running:
./perl -e 'qr/_?[\W_]/;'
from:
==23406== I refs: 1,752,149
==23406== I1 misses: 5,405
==23406== LLi misses: 3,588
==23406== I1 miss rate: 0.30%
==23406== LLi miss rate: 0.20%
==23406==
==23406== D refs: 683,242 (414,061 rd + 269,181 wr)
==23406== D1 misses: 13,370 ( 7,646 rd + 5,724 wr)
==23406== LLd misses: 7,025 ( 3,417 rd + 3,608 wr)
==23406== D1 miss rate: 1.9% ( 1.8% + 2.1% )
==23406== LLd miss rate: 1.0% ( 0.8% + 1.3% )
==23406==
==23406== LL refs: 18,775 ( 13,051 rd + 5,724 wr)
==23406== LL misses: 10,613 ( 7,005 rd + 3,608 wr)
==23406== LL miss rate: 0.4% ( 0.3% + 1.3% )
to:
==25041== I refs: 1,189,412
==25041== I1 misses: 5,218
==25041== LLi misses: 3,598
==25041== I1 miss rate: 0.43%
==25041== LLi miss rate: 0.30%
==25041==
==25041== D refs: 440,339 (283,047 rd + 157,292 wr)
==25041== D1 misses: 11,872 ( 7,257 rd + 4,615 wr)
==25041== LLd misses: 7,024 ( 3,417 rd + 3,607 wr)
==25041== D1 miss rate: 2.6% ( 2.5% + 2.9% )
==25041== LLd miss rate: 1.5% ( 1.2% + 2.2% )
==25041==
==25041== LL refs: 17,090 ( 12,475 rd + 4,615 wr)
==25041== LL misses: 10,622 ( 7,015 rd + 3,607 wr)
==25041== LL miss rate: 0.6% ( 0.4% + 2.2% )
ie. from 1.75 million instructions to 1.19 million instructions.
Karl Williamson [Wed, 2 Mar 2016 17:50:01 +0000 (10:50 -0700)]
PATCH: [perl #127599] Fix regcomp.c assertion
I added this assertion in
cfbef7dc3. It asserts that we have more to
parse. The code in this function is quite complicated, and assumes in a
number of places that there is more to parse. When we don't have more
to parse, 900 lines later, it throws an error. It may be that you can't
get to the places where it assumes there is more to parse if this
assertion is false (I don't remember now from my tedious audit of this
code), but even if so, it is fragile to assume so, given the large
distance to where the error is thrown. So throw the error right away
and avoid any existing or future breakage.
David Mitchell [Wed, 2 Mar 2016 17:29:31 +0000 (17:29 +0000)]
document args of Perl_do_sv_dump()
Jarkko Hietaniemi [Wed, 2 Mar 2016 00:56:04 +0000 (19:56 -0500)]
amigaos4: no sigaction, no si fields