This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Karl Williamson [Wed, 10 Dec 2014 00:45:35 +0000 (17:45 -0700)]
pp_pack.c: Change name of some static functions
Early code tends to conflate the terms Unicode and UTF-8. I find that
confusing.
Karl Williamson [Tue, 17 Feb 2015 16:42:56 +0000 (09:42 -0700)]
perldsc: Wrap too-long verbatim lines
Karl Williamson [Sat, 6 Apr 2013 16:15:05 +0000 (10:15 -0600)]
t/io/bom.t: Generalize for non-ASCII platforms
This commit was updated on February 17, 2015 before being pushed to
blead to incorporate work from Hugo van der Sanden and Dagfinn Ilmari
Mannsåker
Chris 'BinGOs' Williams [Tue, 17 Feb 2015 14:49:50 +0000 (14:49 +0000)]
Update Unicode-Collate to CPAN version 1.11
[DELTA]
1.11 Tue Feb 17 21:23:03 2015
- XS: [rt.cpan.org #102024] remove extranous const casting
Hugo van der Sanden [Mon, 16 Feb 2015 02:42:02 +0000 (02:42 +0000)]
fix handling of non-strict \x{}
It should be equivalent to \x{0}.
Craig A. Berry [Tue, 17 Feb 2015 01:14:30 +0000 (19:14 -0600)]
Remove dead function from vms/vms.c
fix_bare_dirnames is not used anywhere and doesn't actually do
anything. It appears to be a placeholder for something that has
not materialized in the 10 years of it existence, so time to tidy
up.
Tony Cook [Tue, 17 Feb 2015 00:00:37 +0000 (11:00 +1100)]
Tony Cook [Mon, 16 Feb 2015 04:57:00 +0000 (15:57 +1100)]
h2ph: correct handling of hex constants for the preamble
Previously they were treated as identifiers resulting in code
generated like C< &0xFFF >.
We also try to prevent compile-time warnings from large hex integers,
the user isn't responsible for the generated code, so we delay those
warnings to run-time.
Petr Písař [Wed, 11 Feb 2015 14:46:37 +0000 (15:46 +0100)]
Fix Errno.pm generation for gcc-5.0
gcc-5.0 -E interleaves now line numbers with expended macros, so that
the generated errno.c will be preprocessed to
EBFONT => [[
59
]]
which is hard to parse in in line-based reader.
So use -P option with gcc >= 5.0. Global -P usage would break makedepend,
global -ftrack-macro-expansion=0 would break lib/h2ph.t.
RT#123784
Tony Cook [Mon, 16 Feb 2015 22:59:58 +0000 (09:59 +1100)]
Tony Cook [Mon, 16 Feb 2015 00:55:24 +0000 (11:55 +1100)]
[perl #123836] dump LABEL shouldn't be goto LABEL
Tony Cook [Mon, 16 Feb 2015 00:54:25 +0000 (11:54 +1100)]
[perl #123836] basic tests for dump, catches the issue as a TODO
Shlomi Fish [Mon, 16 Feb 2015 14:46:29 +0000 (16:46 +0200)]
Modernize the code - "my" declarations and comments.
For: RT #123636
Chris 'BinGOs' Williams [Mon, 16 Feb 2015 14:53:54 +0000 (14:53 +0000)]
Socket updated to CPAN version 2.018
[DELTA]
2.018 2015/02/12 13:42:41
[BUGFIXES]
* Fix for "addr is not a string" test to use SvPOKp() before 5.18
Chris 'BinGOs' Williams [Mon, 16 Feb 2015 14:52:56 +0000 (14:52 +0000)]
CPAN has version 5.
20150214 now
Father Chrysostomos [Wed, 31 Dec 2014 00:32:59 +0000 (16:32 -0800)]
Deparse state sub defined in inner subs
When we have ‘state sub x; sub { sub x { ... } }’, the actual &x sub-
routine is not contained in the pad of the anonymous sub. There is
only a pad entry pointing to the outer pad. So we have go digging for
it by following ->OUTSIDE pointers.
This is only a partial fix. If you wrap the code above in eval
'sub{...}' and deparse it, the state sub definition is missing,
because it is not available via ->OUTSIDE pointers. I do not know
yet whether it is possible to get to it. The to-do test in Deparse.t
used to croak.
H.Merijn Brand [Mon, 16 Feb 2015 09:38:48 +0000 (10:38 +0100)]
regen uconfig
H.Merijn Brand [Mon, 16 Feb 2015 09:08:28 +0000 (10:08 +0100)]
Small doc change
Steve Hay [Mon, 16 Feb 2015 08:50:00 +0000 (08:50 +0000)]
RMG: Encourage use of analysis.cpantesters.org/beforemaintrelease
Daniel Dragan [Mon, 16 Feb 2015 05:03:07 +0000 (00:03 -0500)]
restore VC with dmake after commit "Fix minitest (op/taint.t) for GCC 4.x"
commit
dbf36b7ad7 broke VC with dmake building by not defining the
test-prep-gcc target for VC builds. Instead of using $(NOOP), which incurs
the cost of dmake lauching another cmd.exe process to execute "rem", use
make lang preprocessor directives. Example of error
C:\perl521\src\win32>dmake test
.......normal building here.....
........cut.........
..\miniperl.exe -I..\lib ..\pod\perlmodlib.PL -q ..
..\perl.exe -f ..\pod\buildtoc -q
dmake: Error: -- `test-prep-gcc' not found, and can't be made
C:\perl521\src\win32>
Father Chrysostomos [Mon, 16 Feb 2015 05:22:00 +0000 (21:22 -0800)]
[perl #123712] Don’t check sub_inwhat
PL_sublex_info.sub_inwhat (in the parser struct) is a temporary spot
to store the value of PL_lex_inwhat (also in the parser struct)
when a sub-lexing scope (for a quote-like operator) is entered.
PL_lex_inwhat is localised, and the value is copied from its temporary
spot (sub_inwhat) into PL_lex_inwhat.
The PL_sublex_info.sub_inwhat was not localised, but instead the value
was set to 0 when a sub-lexing scope was exited. This value was being
used, in a couple of places, to determine whether we were inside a
quote-like operator. But because the value is not localised, it can
be wrong when it is set to 0, if we have nested lexing scopes.
So this ends up crashing for the same reason described in
e47d32dcd5:
echo -n '/$a[m||/<<a' | ./miniperl
perl-5.005_02-1816-g09bef84 added the first use of
PL_sublex_info.sub_inwhat to determine whether we are in a quote-like
operator. (Later it got shifted around.) I copied that in
e47d32dcd5
(earlier today), because I assumed the logic was correct. Other parts
of the code use PL_lex_inwhat, which is already localised, as I said,
and does not suffer this problem.
If we do not check PL_sublex_info.sub_inwhat to see if we are in
a quote-like construct, then we don’t need to clear it on lexing
scope exit.
Hugo van der Sanden [Fri, 13 Feb 2015 12:26:50 +0000 (12:26 +0000)]
[perl #123816] fix stat stacking
The check function for filetests avoids treating '-t stat' as a pair of
stackable filetests, but needs also to avoid treating 'stat -t' as
stackable.
Father Chrysostomos [Mon, 16 Feb 2015 01:11:47 +0000 (17:11 -0800)]
[perl #123712] Fix /$a[/ parsing
The parser used to read more lines of input when parsing code interpo-
lated into quote-like operators, under some circumstance. This would
result in code like this working, even though it should be a syn-
tax error:
s||${s/.*/|;
/s}Just another Perl hacker,
print
"${;s/.*/Just an";
other Perl hacker,
/s} die or return;
print
While this was harmless, other cases, like /$a[/<<a with no trailing
newline, would cause unexpected internal state that did not meet the
reasonable assumptions made by S_scan_heredoc, resulting in a crash.
The simplest fix is to modify the function that reads more input,
namely, lex_next_chunk, and prevent it from reading more lines of
input from inside a quote-like operator. (The alternative would be to
modify all the calls to lex_next_chunk, and make them conditional.)
That breaks here-doc parsing for things like s//<<EOF/, but the
LEX_NO_TERM flag to lex_next_chunk is used only by the here-doc
parser, so lex_next_chunk can make an exception if it is set.
Father Chrysostomos [Sun, 15 Feb 2015 23:43:00 +0000 (15:43 -0800)]
toke.c: Don’t bother setting type for FORMRBRACK
The type is unused, so there is no need to set it to 0.
Father Chrysostomos [Sun, 15 Feb 2015 23:41:20 +0000 (15:41 -0800)]
perly.y: Remove type from ';'
This token’s type is never used. We don’t bother setting the type,
either, in toke.c, so it will be garbage. Removing the type makes
it harder to use the garbage value by mistake in refactoring.
Hugo van der Sanden [Sun, 15 Feb 2015 11:44:00 +0000 (11:44 +0000)]
[perl #123843] fix SEGV reading data->flags
This could be triggered by trying to compile eg 'qr{x+(y(?0))*}'.
Daniel Dragan [Sun, 15 Feb 2015 15:09:39 +0000 (10:09 -0500)]
(rmv dead -I paths for mktables + rmv copying non-existant path) on Win32
Introduced in commit
f54fcafc49 in 5.11.2 , the -I paths are dead since
commit
cb8c84586a in 5.19.6 that renamed dist/Cwd to dist/PathTools . Since
the paths have been invalid for so long with no complaints so remove them.
That -I probably isn't needed anymore because Cwd AKA PathTools have been
in write_buildcustomize.pl since day 1 of write_buildcustomize.pl in
commit
5e4c4c91bd from 5.13.10 .
The makefile line says to copy to /lib the directory win32/lib. win32/lib
has never existed in Perl. There was a win32/ext from commit
b4ad57f4f7 in
5.9.2 to commit
78ff2d7be7 in 5.9.5 but not win32/lib. The useless
makefile rule is from day 1 of makefile.mk in commit
08aa1457cd in 5.004001
which was copied from the win32/Makefile, at the time of commit
08aa1457cd.
win32/Makefile got the win32/lib copy line from day 1 of win32/Makefile in
commit
0a753a7640 , and there was no /win32/lib when /win32 was commited.
Ricardo Signes [Sun, 15 Feb 2015 17:34:05 +0000 (12:34 -0500)]
release schedule udpates through March 2015
Steve Hay [Sun, 15 Feb 2015 16:06:43 +0000 (16:06 +0000)]
Turn on memory leak reporting for CFG = DebugFull builds on Windows
Setting _CRTDBG_LEAK_CHECK_DF arranges for _CrtDumpMemoryLeaks() to be
called automatically at program termination, outputting a report of all
allocations that have not been freed into the Output window in Developer
Studio.
If a leak is reported then note its allocation number, change the -1 in
the _CrtSetBreakAlloc(-1L) call to the leaked allocation number and
rebuild. A breakpoint will be set on the allocation call that leaked.
(A slicker approach is to have the report include the file name and line
number of the leaked allocation call by inserting
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
early in each compilation unit (e.g. by inserting it early in perl.h), but
that works by re-#defining malloc/free etc, which unfortunately clashes
with #defines in win32/win32iop.h and with the 'free' member of the
regexp_engine struct in regexp.h.)
Yves Orton [Sun, 15 Feb 2015 07:45:18 +0000 (15:45 +0800)]
Add comments about how backrefs are parsed
Yves Orton [Sun, 15 Feb 2015 07:38:29 +0000 (15:38 +0800)]
fix infinite loop in parsing backrefs in regex patterns
Yves Orton [Sun, 15 Feb 2015 07:26:22 +0000 (15:26 +0800)]
Add a TODO test for not infinite looping during regex backref parsing
Yves Orton [Sun, 15 Feb 2015 06:53:39 +0000 (14:53 +0800)]
add a comment so people looking for "sub run_perl" find the right thing
Steve Hay [Sat, 14 Feb 2015 19:10:37 +0000 (19:10 +0000)]
Copy perl5202delta into blead
Steve Hay [Sat, 14 Feb 2015 18:49:34 +0000 (18:49 +0000)]
Update release schedule: 5.20.2 is done; 5.20.3 will probably happen
Steve Hay [Sat, 14 Feb 2015 18:43:51 +0000 (18:43 +0000)]
Update Porting/epigraphs.pod for Perl 5.20.2
Steve Hay [Sat, 14 Feb 2015 16:24:32 +0000 (16:24 +0000)]
More updates to Module-CoreList for Perl 5.20.2
The date-based $VERSIONs for the 5.20.2 release need updating too. The
module files' $VERSIONs are left on 5.
20150220 in blead for the impending
release of 5.21.9, though; they will only be updated to 5.
20150214 in the
maint-5.20 branch itself.
Steve Hay [Sat, 14 Feb 2015 15:59:46 +0000 (15:59 +0000)]
Update perlhist: Perl 5.20.2 today
Steve Hay [Sat, 14 Feb 2015 15:59:31 +0000 (15:59 +0000)]
Update Module-CoreList: Perl 5.20.2 today
James E Keenan [Sat, 14 Feb 2015 14:48:51 +0000 (09:48 -0500)]
Two more typographic cleanups, suggested by alh++.
Craig A. Berry [Sat, 14 Feb 2015 14:26:02 +0000 (08:26 -0600)]
Set NAN_COMPARE_BROKEN on VMS with long doubles.
This gets us passing more (but not all) of the infnan.t tests
with long doubles (which are true 128-bit IEEE 754 gizmos).
James E Keenan [Sat, 14 Feb 2015 14:20:42 +0000 (09:20 -0500)]
Correct typo in code example.
Reported by saint.snit++
For: RT #123820
Karl Williamson [Sat, 14 Feb 2015 04:51:56 +0000 (21:51 -0700)]
Unicode::UCD: Generalize for EBCDIC platforms
Karl Williamson [Fri, 13 Feb 2015 22:28:34 +0000 (15:28 -0700)]
Unicode::UCD::prop_aliases(): return correct long and short names
Certain of the Perl extensions did not have the correct long and short
names returned.
Karl Williamson [Fri, 13 Feb 2015 22:14:46 +0000 (15:14 -0700)]
mktables: Rip out redundant tables
Experimentally, we changed the definition of Perl's space to include a
vertical tab, thus being identical to the Posix space definition. In
case we had to back this out, I left these as separate tables, but now
that experiment is considered a success, and those tables can be
collapsed. Later commits will finish up removing the experimental
status of this.
Karl Williamson [Fri, 13 Feb 2015 22:06:15 +0000 (15:06 -0700)]
mktables: Fix looping recursive detection
This code was spuriously finding that the was a loop in what is being
output. Use 'local' to fix it.
Karl Williamson [Fri, 13 Feb 2015 18:08:30 +0000 (11:08 -0700)]
mktables: Remove unused variable
Karl Williamson [Fri, 13 Feb 2015 18:07:21 +0000 (11:07 -0700)]
mktables: Fix typo in comment
David Mitchell [Fri, 13 Feb 2015 12:47:36 +0000 (12:47 +0000)]
bench.pl: fix doc --sort thinko
--sort's arg is field:perl, not perl:field
David Mitchell [Fri, 13 Feb 2015 11:54:53 +0000 (11:54 +0000)]
add some more tests for RT #123743
In addition to /.*/, also check that /.*?/ isn't slow.
Lukas Mai [Fri, 13 Feb 2015 10:07:38 +0000 (11:07 +0100)]
add a comment documenting STATIC_ASSERT_GLOBAL/STATIC_ASSERT_STMT
Steve Hay [Thu, 12 Feb 2015 14:18:06 +0000 (14:18 +0000)]
Add new DebugSymbols and DebugFull CFG options to Windows makefiles
This commit implements the suggestion from perl #123439 of adding a
CFG=DebugSymbols option for a debug mode build without enabling perl's
-DDEBUGGING code, and also adds a CFG=DebugFull option for a debug mode
build which uses the debug version of the CRT and enables -D_DEBUG code
(in perl and in the CRT) such as extra assertions and invalid parameter
warnings. (Note that failed invalid parameter checks are harmless thanks
to perl's invalid parameter handler in win32/win32.c. However, blindly
ignoring them is not a good thing. Compiling with _DEBUG causes the handler
to print warnings on STDERR about checks that have failed. Ideally these
should be fixed, or silenced by some other means if they really are
harmless--as was done for some such warnings by commit
d52ca5864f.)
I attempted to do something like the DebugFull part once before, but was
held back by miniperl not using PerlIO, which resulted in a huge number of
invalid parameter warnings:
http://www.nntp.perl.org/group/perl.perl5.porters/2012/09/msg191674.html
However, that issue was recently removed by commit
8c847e6678, which
removed Windows makefile support for building without PerlIO, including
making miniperl now use PerlIO.
As noted in the makefiles comments, however, there are still a few cases
of invalid parameter warnings, which is partly why I've added the new
DebugFull option, rather than altering the existing Debug option.
Karl Williamson [Thu, 12 Feb 2015 17:19:10 +0000 (10:19 -0700)]
bisect-runner.pl: Fix too long verbatim in pod
Verbatim lines only have to be indented one space to be effective and to
show as offset from the surrounding text. By decreasing the
indentation, this commit causes the lines not to wrap.
Chris 'BinGOs' Williams [Thu, 12 Feb 2015 12:51:06 +0000 (12:51 +0000)]
Update Pod-Perldoc to CPAN version 3.25
[DELTA]
3.25 - Thu Feb 12 03:06:43 UTC 2015
* No changes - roll an official
release for inclusion in Perl 5.22
3.24_02 - Wed Jan 21 03:12:37 UTC 2015
* Dave Mitchell sent a patch to reduce stderr spam
during core perl builds. Resolves RT#101493
* Make perldoc honor the MANPAGER environment
variable as documented. Resolves RT#100933
* Decode command line arguments at UTF-8 data.
Resolves RT#9806
3.24_01 - Wed Sep 10 03:13:58 UTC 2014
* The 'ToTerm' backend generates terminal escape sequences that
the 'less' pager does not display by default. The "-R" option
controls this, so pass it in the LESS environment variable
to avoid disturbing other pager invocations. Patch by
Niko Tyni. Closes RT#98636
* Unify filehandle opens and encoding into two methods
'open_fh' and 'set_encoding'. Based on a pull request
by Koichi KUBO. Closes RT#98019 better than c3fd47f :)
* Applied PR by Olivier Mengué to 'use parent' instead
of 'use base'
Hugo van der Sanden [Thu, 12 Feb 2015 00:11:31 +0000 (00:11 +0000)]
fix assertions for UTF8_TWO_BYTE_HI/LO
Replace the stricter MAX_PORTABLE_UTF8_TWO_BYTE check with a looser
MAX_UTF8_TWO_BYTE check, else we can't correctly convert codepoints in
the range 0x400-0x7ff from utf16 to utf8 on non-ebcdic platforms.
Hugo van der Sanden [Wed, 11 Feb 2015 17:24:33 +0000 (17:24 +0000)]
Add --crash option for Porting/bisect
If --crash is specified, treat test cases as bad only if they exit with
($? & 0xff) non-zero.
Chris 'BinGOs' Williams [Wed, 11 Feb 2015 14:30:08 +0000 (14:30 +0000)]
Update Pod-Parser to CPAN version 1.63
[DELTA]
10-Feb-2015 Marek Rouchal <marekr@cpan.org>
-----------------------------------------------------------------------------
Version 1.63
+ CPAN#101847: [PATCH] Bump $VERSION in module changed since Pod-Parser-1.60
increased VERSION in all *.pm files
+ CPAN#98610: Pod::Find should skip also object directories of modern vc
systems (.git, .hg)
implemented in Pod::Find
Thanks for the reports and patches!
Chris 'BinGOs' Williams [Wed, 11 Feb 2015 14:26:13 +0000 (14:26 +0000)]
Update Config-Perl-V to CPAN version 0.23
[DELTA]
0.23 - 11 Feb 2015, H.Merijn Brand
* Update copyright to 2015
* Add summary tests
* Remove perl recommendation from META as it breaks cpan clients
* Move repo to github
Jarkko Hietaniemi [Wed, 11 Feb 2015 13:49:27 +0000 (08:49 -0500)]
Jarkko Hietaniemi [Wed, 11 Feb 2015 13:24:55 +0000 (08:24 -0500)]
infnan: store the nan payload error in an optional SV
Jarkko Hietaniemi [Wed, 11 Feb 2015 12:55:55 +0000 (07:55 -0500)]
infnan: perldata tweaks
Steve Hay [Tue, 10 Feb 2015 08:51:26 +0000 (08:51 +0000)]
Remove duplicate declaration of win32_stat from win32/win32iop.h
The same declaration appears slightly higher up in the same file.
Steve Hay [Tue, 10 Feb 2015 08:23:22 +0000 (08:23 +0000)]
Silence compiler warnings with gcc 4.7.2 and 4.8.1 from mingw.org
These compilers (with other contemporaneous packages, I forget exactly
which versions of everything I have installed) contain
#define fstat _fstat
in include/sys/stat.h, which clashes with win32/win32iop.h's #define and
causes "warning: "fstat" redefined [enabled by default]" for just about
every .c file compiled. Likewise for stat.
Karl Williamson [Thu, 22 Jan 2015 22:06:43 +0000 (15:06 -0700)]
Unicode::UCD: Fix synopsis
Instead of using a constant code point in some of the lines, use the
$variable that is used in other lines
Spotted by Dagfinn Ilmari Mannsåker
Jarkko Hietaniemi [Wed, 11 Feb 2015 00:37:54 +0000 (19:37 -0500)]
infnan: separate the nan payload overflow and invalid messages
Also: display the payload, and the number of bits
Jarkko Hietaniemi [Tue, 10 Feb 2015 18:26:50 +0000 (13:26 -0500)]
infnan: change the invalid nan message, add to perldiag
Jarkko Hietaniemi [Tue, 10 Feb 2015 18:18:20 +0000 (13:18 -0500)]
infnan: "nan(1)cy" should numify to $NaN, but also warn
More test cases.
Karl Williamson [Tue, 27 Jan 2015 22:08:08 +0000 (15:08 -0700)]
Unicode::UCD: Add prop_values() function
This new function returns the input property's possible values.
Chris 'BinGOs' Williams [Tue, 10 Feb 2015 16:12:31 +0000 (16:12 +0000)]
Update Socket to CPAN version 2.017
[DELTA]
2.017 2015/02/10 12:05:14
[CHANGES]
* Added some more SO_* constants defined on Linux (thanks
Ronald van Dorp)
[BUGFIXES]
* Remember to SvGETMAGIC in getnameinfo() (RT79557)
* Quiet some compiler warnings (RT101495, RT100736)
* Fix "Attempt to free unreferenced scalar" warnings (RT78626, et.al.)
David Mitchell [Tue, 10 Feb 2015 15:03:54 +0000 (15:03 +0000)]
remove invalid ASSUME from MULTIDEREF code
RT #123735
The code that examines ops looking for OP_MULTIDEREF candidates,
makes assertions about what flags it think can be present on ops;
the idea being that if those assumptions change, the optimisation
code may need changing too.
However, the following syntax-errored code
print
my(r)
can trigger the assertion about PARENS not being set on an OP_GV.
So don't assert that.
Hugo van der Sanden [Tue, 10 Feb 2015 14:25:42 +0000 (14:25 +0000)]
[perl #123782] regcomp: check for overflow on /(?123)/
AFL (<http://lcamtuf.coredump.cx/afl>) found that the UV to I32 conversion
can evade the necessary range checks on wraparound, leading to bad reads.
Check for it, and force to I32_MAX, expecting that this will usually
yield a "Reference to nonexistent group" error.
David Mitchell [Tue, 10 Feb 2015 12:17:51 +0000 (12:17 +0000)]
simpify and speed up /.*.../ handling
See RT ##123743.
A pattern that starts /.*/ has a fake MBOL or SBOL flag added, along
with PREGf_IMPLICIT.
The idea is that, with /.*.../s, if the NFA don't match when started at
pos 0, then it's not going to match if started at any other position
either; while /.*.../ won't match at any other start position up until
the next \n.
However, the branch in regexec() that implemented this was a bit a mess
(like much in the perl core, it had gradually accreted), and caused
intuit-enabled /.*.../ and /.*...patterns to go quadratic.
The branch looked roughly like:
if (anchored) {
if (regtry(s)) goto success;
if (can_intuit) {
while (s < end) {
s = intuit(s+1);
if (!s) goto fail;
if (regtry(s)) goto success;
}
}
else {
while (s < end) {
s = skip_to_next_newline(s);
if (regtry(s)) goto success;
}
}
}
The problem is that in the presence of a .* at the start of the pattern,
intuit() will always return either NULL on failure, or the start position,
rather than any later position. So the can_intuit branch above calls
regtry() on every character position.
This commit fixes this by changing the structure of the code to be like
this, where it only tries things on newline boundaries:
if (anchored) {
if (regtry(s)) goto success;
while (1) {
s = skip_to_next_newline(s);
if (can_intuit) {
s = intuit(s+1);
if (!s) goto fail;
}
if (regtry(s)) goto success;
}
}
This makes the code a lot simpler, and mostly avoids quadratic behaviour
(you can still get it with a string consisting mainly of newlines).
Tony Cook [Tue, 10 Feb 2015 06:02:59 +0000 (17:02 +1100)]
perldelta for
f5fe1b19fc61
Tony Cook [Tue, 10 Feb 2015 04:54:16 +0000 (15:54 +1100)]
remove the shell fallback from list pipe open on Win32
This is a potential security issue, and while we'd need a deprecation
cycle to remove it from system(), there hasn't been a production
release of perl with list pipe open, so we can pretend it never was.
Without the shell, CreateProcess() won't pick up .cmd or .bat files,
which several perl utilities are packaged as on Win32, so use
qualified_path() to produce a full executable name.
Hugo van der Sanden [Tue, 10 Feb 2015 02:09:13 +0000 (02:09 +0000)]
regcomp can read past end of string after parsing flags
New test in
8a6d8ec6fe revealed additional code problem reading past
end of string under clang with sanitize=address.
Tony Cook [Tue, 10 Feb 2015 00:25:22 +0000 (11:25 +1100)]
Tony Cook [Tue, 10 Feb 2015 00:24:22 +0000 (11:24 +1100)]
[perl #123554] fix threaded builds and prevent a warning
Tony Cook [Mon, 9 Feb 2015 23:19:56 +0000 (10:19 +1100)]
[perl #123554] catch a couple of other size overflows
Unfortunately, running out of memory in safesysmalloc() and
safesysrealloc() doesn't produce a catchable croak(), so remove the
test.
Hugo van der Sanden [Sat, 7 Feb 2015 16:31:04 +0000 (16:31 +0000)]
[perl #123755] including unknown char in error requires care
AFL (<http://lcamtuf.coredump.cx/afl>) found that when producing the
error message for /(??/ we hit an assert because we've stepped past
the end of the pattern string. Code inspection found that we also do
that in other branches, and we also need to check UTF more carefully.
Hugo van der Sanden [Sun, 8 Feb 2015 13:53:00 +0000 (13:53 +0000)]
[perl #123759] always count on OPpTRANS_IDENTICAL
If we detect that an in-place transliteration will not result in any
changes to the string, we set OPpTRANS_IDENTICAL and skip the normal
checks for readonlyness; but if we do that, we must make sure to use
the same logic to decide which transliteration strategy to use, or
we may end up trying to write to the readonly string anyway.
This resulted in several ways to hit assert failures, found by AFL
(<http://lcamtuf.coredump.cx/afl>).
Father Chrysostomos [Mon, 9 Feb 2015 05:29:59 +0000 (21:29 -0800)]
[perl #123677] Crash with token stack overflow
In this naughty code snippet:
s)$0{0h());qx(@0);qx(@0);qx(@0)
the s)...)) is treated as a substition, with $0{0h( for the left part.
When the lexer reaches the h( it tries to emit two tokens at once, '&'
and a WORD token representing the h. To do that it pushes the WORD on
to the pending token stack and then emits '&'. The next call to yylex
will usually pop the token off the pending stack and use that, because
the lexing state (PL_lex_state) is LEX_KNOWNEXT.
However, when the parser sees '&', it immediately reports it as
a syntax error, and tries to pop tokens to make sense of what it
has, popping scopes in the process. Inside a quote-like operator,
PL_lex_state is localised, so the value after this scope-popping is
no longer LEX_KNOWNEXT, so the next call to yylex continues parsing
‘;qx...’ and ignores the pending token.
When it reaches the @0 inside the qx, it tries to push five pending
tokens on to the stack at once, because that’s how the implicit join
works. But the stack only has room for five items. Since it already
has one, the last item overflows, corrupting the parser state.
Crashes ensue.
If we check for the number of pending tokens and always emit any
regardless of the lexing state, then we avoid the crash. This is
arguably how it should have been written to begin with.
This makes LEX_KNOWNEXT, and probably PL_lex_defer, redundant, but I
will wait till after perl 5.22 before removing those, as the removal
may break CPAN modules, and this is a little late in the dev cycle.
Father Chrysostomos [Mon, 9 Feb 2015 04:24:15 +0000 (20:24 -0800)]
toke.c: Assert that we don’t overflow token stack
With this assertion, the test case from #123743 fails sooner.
Father Chrysostomos [Mon, 9 Feb 2015 04:04:50 +0000 (20:04 -0800)]
Consistent spaces after dots in perldata
Jarkko Hietaniemi [Sat, 7 Feb 2015 23:13:43 +0000 (18:13 -0500)]
infnan: document the infnan a bit
Jarkko Hietaniemi [Sat, 7 Feb 2015 20:09:05 +0000 (15:09 -0500)]
infnan: test nan payload input/output
Jarkko Hietaniemi [Sat, 7 Feb 2015 22:27:24 +0000 (17:27 -0500)]
infnan: add POSIX::issignaling
The current best guess for the eventual name of the C interface.
(http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1664.pdf)
Jarkko Hietaniemi [Sun, 8 Feb 2015 17:45:01 +0000 (12:45 -0500)]
infnan: the nan quiet/signaling bit is not enough
Jarkko Hietaniemi [Sat, 7 Feb 2015 20:47:59 +0000 (15:47 -0500)]
infnan: the x86 80-bit extended precision is special
Jarkko Hietaniemi [Sun, 8 Feb 2015 00:39:55 +0000 (19:39 -0500)]
infnan: API context juggling
Jarkko Hietaniemi [Sat, 7 Feb 2015 20:07:08 +0000 (15:07 -0500)]
infnan: grok_number* setting the infnan NV directly
Jarkko Hietaniemi [Sat, 7 Feb 2015 19:42:47 +0000 (14:42 -0500)]
infnan: nan payload output with sprintf %#g
Jarkko Hietaniemi [Sat, 7 Feb 2015 19:48:22 +0000 (14:48 -0500)]
infnan: space for nan payload output
Jarkko Hietaniemi [Sat, 7 Feb 2015 19:31:25 +0000 (14:31 -0500)]
infnan: move S_hextract earlier
Jarkko Hietaniemi [Sat, 7 Feb 2015 19:28:30 +0000 (14:28 -0500)]
infnan: add grok_nan and grok_nan_payload
Jarkko Hietaniemi [Sat, 7 Feb 2015 19:16:04 +0000 (14:16 -0500)]
infnan: add nan_payload_set
Jarkko Hietaniemi [Sat, 7 Feb 2015 18:12:33 +0000 (13:12 -0500)]
infnan: add nan_is_signaling
Jarkko Hietaniemi [Sat, 7 Feb 2015 14:29:31 +0000 (09:29 -0500)]
infnan: add nan_signaling_set
Jarkko Hietaniemi [Sat, 7 Feb 2015 14:27:05 +0000 (09:27 -0500)]
infnan: add nan_hibyte
Jarkko Hietaniemi [Sat, 7 Feb 2015 18:27:42 +0000 (13:27 -0500)]
infnan: do not define NV_NAN from a signaling nan
This is not a strong guarantee that the NV_NAN is a quiet NaN.
Father Chrysostomos [Sun, 8 Feb 2015 20:45:12 +0000 (12:45 -0800)]
Remove get-magic from $/
and use a different approach to prevent $/ from being set to a bad
value.
This should fix ticket #123739. Commit v5.21.8-197-g5fe499a made
$/’s get-magic read PL_rs, so that the croak when setting $/ to a
bad value would not leave $/ with that bad value, in order to fix
bug #123218.
Some CPAN modules do not like $/ reading PL_rs that way. So we
have to change this back. I am not actually removing the get-
magic, but just making it a no-op, as it was before. The set-
magic now sets $/ back to its previous value before croaking.