This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Steve Hay [Mon, 30 Mar 2015 07:38:07 +0000 (08:38 +0100)]
No need to list FindExt in perldelta - it isn't an installed module
Steve Hay [Mon, 30 Mar 2015 07:35:36 +0000 (08:35 +0100)]
Sort list of upgraded modules in perldelta
Steve Hay [Mon, 30 Mar 2015 07:34:26 +0000 (08:34 +0100)]
perldelta for previous commit
Steve Hay [Thu, 26 Mar 2015 08:26:27 +0000 (08:26 +0000)]
Upgrade IO-Socket-IP from version 0.36 to 0.37
Karl Williamson [Mon, 30 Mar 2015 03:23:54 +0000 (21:23 -0600)]
perlrecharclass: Fix typo
Karl Williamson [Mon, 30 Mar 2015 03:23:14 +0000 (21:23 -0600)]
perlrebackslash: Nit
Randy Stauner [Sat, 28 Mar 2015 17:42:17 +0000 (10:42 -0700)]
Reword reference to $ENV{PERL_UNICODE} in utf8
"The $ENV{...}," doesn't read well;
Spell it out for consistency with perlrun.
Committer: Increment $VERSION and add entry to perldelta.
Karl Williamson [Sun, 29 Mar 2015 02:54:49 +0000 (20:54 -0600)]
perlhacktips: Add caution about clib ptr returns to static memory
Karl Williamson [Sat, 28 Mar 2015 04:18:01 +0000 (22:18 -0600)]
Don't raise Wide char warning in UTF-8 locale
This belongs in the category of "I can't believe I did that." Commit
613abc6d16e99bd9834fe6afd79beb61a3a4734d introduced warning messages
when a multi-byte character is operated on in a single byte locale. But
the two macros introduced fail to suppress said messages when in a
multi-byte locale where the operation is perfectly valid.
This partially solves v5.22 blocker [perl #123527]. But it could still
fail if the test files are called from within a non-UTF-8 locale. I
will issue a pull request for fixing that.
Father Chrysostomos [Fri, 27 Mar 2015 20:30:29 +0000 (13:30 -0700)]
[perl #124153] Fix require(v5.6)
For some reason the argument to require v5.6 has the NOK flag on,
but the parenthesized version lacks that flag, so the code added in
v5.21.3-504-ged6f447 to precompute the hash was wrong, and caused
require(v5.6) to lose its vstringness.
Alex Vandiver [Mon, 23 Mar 2015 03:08:24 +0000 (23:08 -0400)]
Fix "...without parentheses is ambuguous" warning for UTF-8 function names
While isWORDCHAR_lazy_if is UTF-8 aware, checking advanced byte-by-byte.
This lead to errors of the form:
Passing malformed UTF-8 to "XPosixWord" is deprecated
Malformed UTF-8 character (unexpected continuation byte 0x9d, with
no preceding start byte)
Warning: Use of "�" without parentheses is ambiguous
Use UTF8SKIP to advance character-by-character, not byte-by-byte.
Alex Vandiver [Mon, 23 Mar 2015 02:45:54 +0000 (22:45 -0400)]
Allow unquoted UTF-8 HERE-document terminators
When not explicitly quoted, tokenization of the HERE-document terminator
dealt improperly with multi-byte characters, advancing one byte at a
time instead of one character at a time. This lead to
incomprehensible-to-the-user errors of the form:
Passing malformed UTF-8 to "XPosixWord" is deprecated
Malformed UTF-8 character (unexpected continuation byte 0xa7, with
no preceding start byte)
Can't find string terminator "EnFra�" anywhere before EOF
If enclosed in single or double quotes, parsing was correctly effected,
as delimcpy advances byte-by-byte, but looks only for the single-byte
ending character.
When doing a \w+ match looking for the end of the word, advance
character-by-character instead of byte-by-byte, ensuring that the size
does not extend past the available size in PL_tokenbuf.
Alex Vandiver [Mon, 23 Mar 2015 02:39:23 +0000 (22:39 -0400)]
[perl #124113] Make check for multi-dimensional arrays be UTF8-aware
During parsing, toke.c checks if the user is attempting provide multiple
indexes to an array index:
$a[ $foo, $bar ];
However, while checking for word characters in variable names is aware
of multi-byte characters if "use utf8" is enabled, the loop is only
advanced one byte at a time, not one character at a time. As such,
multibyte variables in array indexes incorrectly yield warnings:
Passing malformed UTF-8 to "XPosixWord" is deprecated
Malformed UTF-8 character (unexpected continuation byte 0x9d, with
no preceding start byte)
Switch the loop to advance character-by-character if UTF-8 semantics are
in use.
Father Chrysostomos [Fri, 27 Mar 2015 19:39:54 +0000 (12:39 -0700)]
[perl #124099] Wrong CvOUTSIDE in find_lexical_cv
Instead of following the chain of CvOUTSIDE pointers, I had it always
looking at the CvOUTSIDE pointer of the current PL_compcv. So any
time it had to dig down more than one level, it had a chance of crash-
ing or looping.
Father Chrysostomos [Fri, 27 Mar 2015 16:23:41 +0000 (09:23 -0700)]
Stop $^H |= 0x1c020000 from enabling all features
That set of bits sets the feature bundle to ‘custom’, which means that
the features are set by %^H, and also indicates that %^H has been did-
dled with, so it’s worth looking at.
In the specific case where %^H is untouched and there is no corres-
ponding cop hint hash behind the scenes, Perl_feature_is_enabled (in
toke.c) ends up returning TRUE.
Commit v5.15.6-55-g94250ae sped up feature checking by allowing
refcounted_he_fetch to return a boolean when checking for existence,
instead of converting the value to a scalar, whose contents we are not
even going to use.
This was when the bug started happening. I did not update the code
path in refcounted_he_fetch that handles the absence of a hint hash.
So it was returning &PL_sv_placeholder instead of NULL; TRUE instead
of FALSE.
This did not cause problems for most code, but with the introduction
of the new bitwise ops in v5.21.8-150-g8823cb8, it started causing
uni::perl to fail, because they were implicitly enabled, making ^ a
numeric op, when it was being used as a string op.
Karl Williamson [Fri, 27 Mar 2015 03:33:04 +0000 (21:33 -0600)]
if.pm: Note that works with 'no' besides 'use'
Father Chrysostomos [Thu, 26 Mar 2015 19:44:57 +0000 (12:44 -0700)]
[perl #123790] Disable targlex for some ops
The targlex optimisation (which makes the op write directly to the
lexical in $lexical = some op, skipping the assignment) does not take
typeglob assignment into account. Since this optimisation has been
enabled for some ops in 5.21.x, we actually have a regression. So
this commit disables the optimisation once more for ops that did not
have it on in 5.20. This is a temporary fix, until we find a better
overall fix. Other ops that still have the optimisation are buggy,
but no more buggy than in 5.20.
Father Chrysostomos [Thu, 26 Mar 2015 15:48:57 +0000 (08:48 -0700)]
concat2.t: Mention where concat.t is
When this comment was written, they were both in the same folder, but
concat.t has since moved.
Matthew Horsfall (alh) [Thu, 26 Mar 2015 20:55:11 +0000 (16:55 -0400)]
Update supported versions in perlpolicy.pod
Father Chrysostomos [Thu, 26 Mar 2015 05:55:20 +0000 (22:55 -0700)]
[perl #124160] Disable targlex for state var init
The targlex optimisation optimises away an assignment to a lexical
variable, having the operator on the rhs write directly to the lexi-
cal itself. This optimisation has a bug in it (#101640) that causes
$lex = "a $b c" to stringify the result, instead of allowing con-
cat overloding to return something other than a string. I extended
the optimisation to occur with state variable initialization, in
v5.21.5-366-ga1b22ab, not realising it would make an existing bug
occur more often. For now, just disable the new optimisation.
Father Chrysostomos [Wed, 25 Mar 2015 17:33:44 +0000 (10:33 -0700)]
[perl #123790] Assert fail with *x=<y>
When assigning undef to its target, readline needs to take into
account that it might be a typeglob. sv_setsv knows how handle this,
but SvOK_off is simply wrong.
This fixes this particular crash, but other issues in the ticket are
as yet unresolved.
Father Chrysostomos [Wed, 25 Mar 2015 21:15:05 +0000 (14:15 -0700)]
Add B::Generate to perl5220delta
so I can close #123718.
David Mitchell [Wed, 25 Mar 2015 16:04:58 +0000 (16:04 +0000)]
perlfunc: mention that study() is currently a noop
Father Chrysostomos [Wed, 25 Mar 2015 05:10:20 +0000 (22:10 -0700)]
Increase $XS::APItest::VERSION to 0.72
Tony Cook [Mon, 2 Mar 2015 04:59:32 +0000 (15:59 +1100)]
gv_const_sv() handle subrefs directly in the stash
With
2eaf799e sub declarations can store sub references directly in
the stash, but gv_const_sv(), which might be passed an entry from
the stash didn't handle that case.
Father Chrysostomos [Wed, 25 Mar 2015 05:03:15 +0000 (22:03 -0700)]
regen pod issues
Father Chrysostomos [Wed, 25 Mar 2015 05:02:11 +0000 (22:02 -0700)]
[perl #122322] Update OOK example in perlguts
It was not just the COW changes that needed to be accounted for, but
also the change in the storage of the offset. The latter changed hap-
pened in 5.12, I think.
Hugo van der Sanden [Tue, 24 Mar 2015 07:29:55 +0000 (07:29 +0000)]
fix signed/unsigned mismatch in (M)EXTEND
A large enough allocation request could wrap, causing MEXTEND to decide
the stack was already big enough.
Father Chrysostomos [Wed, 25 Mar 2015 00:57:14 +0000 (17:57 -0700)]
Deparse.t: test <<>>
Nicholas Clark [Tue, 24 Mar 2015 19:59:04 +0000 (20:59 +0100)]
Bump Deparse's $VERSION following commit
65ef2c3e7d945498.
Rafael Garcia-Suarez [Tue, 24 Mar 2015 14:40:27 +0000 (15:40 +0100)]
Correctly deparse <<>>
David Golden [Mon, 23 Mar 2015 15:51:09 +0000 (11:51 -0400)]
discourage use warnings FATAL => 'all'
After additional discussions on perl5-porters and #p5p, no one seems to
be violently objecting to the idea that FATAL warnings need a much
stronger warning about risks and that FATAL => 'all' should actually be
'discouraged' in the official, perlpolicy sense.
The text of this commit has been posted to perl5-porters for discussion
and approved by those who objected to earlier language.
I dare not call it "consensus" for fear of the consequences, but no one
has raised further obstacles to making this change.
Dagfinn Ilmari Mannsåker [Wed, 18 Mar 2015 00:37:04 +0000 (01:37 +0100)]
Replace common Emacs file-local variables with dir-locals
An empty cpan/.dir-locals.el stops Emacs using the core defaults for
code imported from CPAN.
Committer's work:
To keep t/porting/cmp_version.t and t/porting/utils.t happy, $VERSION needed
to be incremented in many files, including throughout dist/PathTools.
perldelta entry for module updates.
Add two Emacs control files to MANIFEST; re-sort MANIFEST.
For: RT #124119.
Steve Hay [Fri, 20 Mar 2015 19:50:24 +0000 (19:50 +0000)]
Prepare Module::CoreList for 5.21.11 (if that happens)
Steve Hay [Fri, 20 Mar 2015 19:30:03 +0000 (19:30 +0000)]
Module-CoreList version 5.
20150320 is now on CPAN
Steve Hay [Fri, 20 Mar 2015 19:26:50 +0000 (19:26 +0000)]
Bump version for 5.21.11 (if that happens)
Steve Hay [Fri, 20 Mar 2015 19:15:54 +0000 (19:15 +0000)]
Create new perldelta for 5.21.11 (if that happens)
Steve Hay [Fri, 20 Mar 2015 19:14:28 +0000 (19:14 +0000)]
Tick off the 5.21.10 release
Steve Hay [Fri, 20 Mar 2015 19:14:11 +0000 (19:14 +0000)]
Add 5.21.10 epigraph
Steve Hay [Fri, 20 Mar 2015 16:16:07 +0000 (16:16 +0000)]
Add 5.21.10 to perlhist
Steve Hay [Fri, 20 Mar 2015 16:15:55 +0000 (16:15 +0000)]
Finalize perldelta
Steve Hay [Fri, 20 Mar 2015 16:04:39 +0000 (16:04 +0000)]
Update Module-CoreList for 5.21.10
Steve Hay [Fri, 20 Mar 2015 15:33:53 +0000 (15:33 +0000)]
Devel::PPPort has been upgraded from version 3.28 to 3.31
Steve Hay [Fri, 20 Mar 2015 15:26:56 +0000 (15:26 +0000)]
perldelta - Copy-editing, and wrap lines to 79 columns
Steve Hay [Fri, 20 Mar 2015 15:13:01 +0000 (15:13 +0000)]
perldelta - Remove boilerplate sections
Karl Williamson [Fri, 20 Mar 2015 15:00:55 +0000 (09:00 -0600)]
perldelta: Fix typo
Steve Hay [Fri, 20 Mar 2015 14:23:20 +0000 (14:23 +0000)]
perldelta - Document remaining changes/module upgrades and fill in RT links
Steve Hay [Fri, 20 Mar 2015 13:16:26 +0000 (13:16 +0000)]
Unicode::Collate has been upgraded from version 1.11 to 1.12
Jarkko Hietaniemi [Fri, 20 Mar 2015 11:07:21 +0000 (07:07 -0400)]
Update Unicode-Collate to CPAN version 1.12
[DELTA]
1.12 Mon Mar 16 20:21:15 2015
- XS: [rt.cpan.org #102663] IRIX 6.5 failures with Unicode::Collate
(porting: avoid non-zero values in the initializer of an array)
Karl Williamson [Fri, 20 Mar 2015 04:49:21 +0000 (22:49 -0600)]
perldelta for EBCDIC now working
Karl Williamson [Fri, 20 Mar 2015 04:16:15 +0000 (22:16 -0600)]
unicore/README.perl:perl with older Unicode versions
I tried to make the necessary changes for Perl v5.22 to work with old
Unicode versions, but ran out of time before the code freeze, with 5.1
being the earliest version. The sticking point there is that the
Capital Sharp S, U+1E9E, was defined in that release. Because of its
anomalous behavior with the infamous lower case sharp s, U+00DF, there
is a bunch of hard-coded references to it in the C code which need to be
adjusted to handle it's absence.
Karl Williamson [Fri, 20 Mar 2015 04:10:36 +0000 (22:10 -0600)]
Update information about using older Unicode
Karl Williamson [Fri, 20 Mar 2015 03:49:30 +0000 (21:49 -0600)]
regcomp.c: Fix so works on Unicode 5.2
Unicode 5.2 had an anomalous situation, fixed in the next release, which
runs afoul of an assert() in regcomp.c. This just modifies the assert
for it to not fail for this situation.
Karl Williamson [Fri, 20 Mar 2015 03:35:11 +0000 (21:35 -0600)]
regen/mk_invlists.pl: Handle earlier Unicode versions
There are now hard-coded references in regexec.c to enum values for
\b{}. Perl is supposed to work when compiled with earlier Unicode
releases, but these had fewer of these enum values. This commit causes
mk_invlists.pl to make sure any missing ones are defined. This means we
don't have to #ifdef the code. An earlier release without an enum value
obviously won't have any code points that map to that value.
Karl Williamson [Fri, 20 Mar 2015 03:00:15 +0000 (21:00 -0600)]
mktables: Better work with earlier Unicodes
Unicode adds new files to its character database from time to time in
new versions of the Standard. mktables is supposed to be able to handle
this when it knows about a file, but it is compiling a version of the
Standard that predates that file's existence. It was not dealing
properly with this situation.
Karl Williamson [Thu, 26 Feb 2015 06:19:39 +0000 (23:19 -0700)]
Change /(?[...]) to have normal operator precedence
This experimental feature now has the intersection operator ("&") higher
precedence than the other binary operators.
Father Chrysostomos [Fri, 20 Mar 2015 02:58:09 +0000 (19:58 -0700)]
perldelta for #123995 /
b24768f02
Father Chrysostomos [Fri, 20 Mar 2015 02:57:29 +0000 (19:57 -0700)]
perldelta for #124004 /
c5f78d08da
Father Chrysostomos [Fri, 20 Mar 2015 02:55:26 +0000 (19:55 -0700)]
perldelta for #123847 /
3d50185de
Father Chrysostomos [Fri, 20 Mar 2015 02:54:22 +0000 (19:54 -0700)]
perldelta for #123963 /
9d58dbc453
Father Chrysostomos [Fri, 20 Mar 2015 02:52:34 +0000 (19:52 -0700)]
perldelta for #123955 /
ce7c414ee7
Father Chrysostomos [Fri, 20 Mar 2015 02:51:29 +0000 (19:51 -0700)]
perldelta for #123817 /
6b2b48acae
Father Chrysostomos [Fri, 20 Mar 2015 02:47:24 +0000 (19:47 -0700)]
perldelta for #123763 /
26f4cc19a
and
55b398034, too.
Father Chrysostomos [Fri, 20 Mar 2015 02:46:27 +0000 (19:46 -0700)]
perldelta for #123802 /
479ae48e22f11
and
66edcf79f
Father Chrysostomos [Fri, 20 Mar 2015 02:45:49 +0000 (19:45 -0700)]
perldelta for #123801 /
f4460c6f7a0
Steve Hay [Fri, 20 Mar 2015 00:49:12 +0000 (00:49 +0000)]
perldelta module updates
Steve Hay [Fri, 20 Mar 2015 00:44:19 +0000 (00:44 +0000)]
Carp::Heavy is no longer customized
Ricardo Signes [Thu, 19 Mar 2015 23:26:53 +0000 (19:26 -0400)]
Carp::Heavy is no longer customized
Ricardo Signes [Thu, 19 Mar 2015 22:59:54 +0000 (18:59 -0400)]
Carp: remove unneeded VERSION eval, bump version
Ricardo Signes [Thu, 19 Mar 2015 22:59:39 +0000 (18:59 -0400)]
Carp: avoid hardcoded lines and filenames in test
Matthew Horsfall (alh) [Tue, 17 Mar 2015 13:10:43 +0000 (09:10 -0400)]
Bump Devel::PPPort version to 3.31
Karl Williamson [Thu, 19 Mar 2015 20:41:14 +0000 (14:41 -0600)]
perl.h: Fix nit in comment
Karl Williamson [Thu, 19 Mar 2015 20:39:06 +0000 (14:39 -0600)]
Document API for XS LC_NUMERIC locale manipulation
XS writers may need to manipulate the LC_NUMERIC locale. Some macros
are available to do this. This documents them and the issues.
Karl Williamson [Thu, 19 Mar 2015 03:58:24 +0000 (21:58 -0600)]
perllocale: Correctly document behavior
Karl Williamson [Thu, 19 Mar 2015 19:28:30 +0000 (13:28 -0600)]
perl.h: White-space only
Remove some empty /**/ and align line continuation backslashes onto tab
boundaries
Karl Williamson [Thu, 19 Mar 2015 19:06:27 +0000 (13:06 -0600)]
Change some locale manipulation macros in prep for API
This changes the way some of the current internal-only macros are named
and used in order to simplify things and minimize what gets exposed as
part of the API.
Although these have not been listed as publicly available, it costs
essentially nothing to keep the old names around in case someone was
illegally using them.
Karl Williamson [Thu, 19 Mar 2015 17:23:58 +0000 (11:23 -0600)]
regen/regcharclass.pl: Need to rebuild when source files change
Like regen/mk_invlists.pl, if any of various Unicode-related files
change, we can't rely on the generated file remaining unchanged.
Karl Williamson [Thu, 19 Mar 2015 17:05:50 +0000 (11:05 -0600)]
regen/mk_invlists.pl depends on mktables
If mktables changes, the input data for this may also change.
Karl Williamson [Fri, 13 Mar 2015 18:20:18 +0000 (12:20 -0600)]
regen/mk_invlists.pl: Don't quit so easily
Like the previous commit, this script may be called before mktables.lst
exists, and we can't generate mktables.lst without this script
executing to completion. The missing file is only used to determine if
something has changed that we would need to recompile for so this script
can run faster next time it is called.
Karl Williamson [Fri, 13 Mar 2015 18:06:40 +0000 (12:06 -0600)]
regen/regen_lib.pl: Don't die on missing digest
regen_lib now has the capability of calculating a digest for various
files passed to it, and saving those values in the generated output
file. The passed in files are supposed to be the sources of the
generated file, so that on future regen runs, if no digest value has
changed, there should be no need to actually do the (potentially slow)
regen.
When bootstrapping up a perl, not everything may have been built before
a regen is attempted. This was dieing under those conditions,
preventing the build from happening. Thus we come to a dead-end.
This commit causes a random digest to be generated for a source file
that doesn't (yet) exist, instead of dieing. That means that the build
can continue, and the source should be generated at some point in
it. The random digest is not going to match the real one, so the next
time the regen happens, it will signal that things need to be rebuilt,
and then the actual digest of the source will be calculated and
stored.
Having the fake digest be a random number makes sure that, should the
missing file remain missing, that the regen will continue to rebuild
things each time. So, if someone carelessly commits the result without
realizing there is an empty source, the Porting tests will fail, drawing
attention to the problem.
Steve Hay [Thu, 19 Mar 2015 21:09:42 +0000 (21:09 +0000)]
Upgrade parent from version 0.228 to 0.232
Karl Williamson [Thu, 19 Mar 2015 16:07:38 +0000 (10:07 -0600)]
lib/perl5db.pl: Fix pod typo
Karl Williamson [Sun, 15 Mar 2015 03:50:49 +0000 (21:50 -0600)]
lib/perl5db.pl: Generalize for EBCDIC
Karl Williamson [Sun, 15 Mar 2015 03:50:27 +0000 (21:50 -0600)]
Create single fcn for dup'd /lib code
Several /lib .pm's have the same code which is complicated enough to
warrant being placed in a shared function. This commit creates a .pm
to be used by these .pm's.
This implements the perhaps archaic 'Meta' notation wherein characters
above 0x7f are displayed as M- plus the ASCII-range character derived by
looking at only the lower 7 bits of the upper range one. There are
problems with this, in that a literal control character can be in the
string, whereas it is trying to get rid of control characters. But I
left it to work as-is, just centralizing the code.
On EBCDIC platforms this notation makes no sense because the bit
patterns are all mixed up about having the upper bit set. So this
commit fixes things on these platforms, so these are changed to
\x{...}. No literal control characters are emitted.
Another potential problem is that characters above 0xFF are passed
through, unchanged. But again, I let the existing behavior stand.
Karl Williamson [Mon, 16 Mar 2015 17:14:12 +0000 (11:14 -0600)]
Change name of mro.c
This is to prevent a conflict showing up on z/OS (os390) because this
file's name is the same as one in /ext, and there are functions
cross-referenced between them, and the loader on that platform
can't deal with this.
See http://nntp.perl.org/group/perl.perl5.porters/226612
Nicholas Clark [Tue, 17 Mar 2015 14:25:02 +0000 (15:25 +0100)]
dbmopen() with a third argument of undef can create files on disk.
Hence we need to ensure that they are cleaned up.
Karen Etheridge [Thu, 19 Mar 2015 02:13:56 +0000 (19:13 -0700)]
Fix rendering of this code snippet in 'perldoc -f chomp'
In text, formerly rendered as: ("$/ = """)
Now rendered as: ("$/ = ''") which is a tad less confusing
Karl Williamson [Wed, 18 Mar 2015 21:56:48 +0000 (15:56 -0600)]
t/re/pat_re_eval.t: Skip encoding tests on EBCDIC
These require changes to Encode which are not planned
to be put in v5.22
Karl Williamson [Thu, 4 Apr 2013 03:56:02 +0000 (21:56 -0600)]
t/op/pack.t: Generalize for EBCDIC
There are still a few failures that are skipped and should be looked at
in v5.23.
David Mitchell [Wed, 18 Mar 2015 17:06:49 +0000 (17:06 +0000)]
smartmatch: handle stack realloc
When smartmatch is matching a pattern against something, it was
failing to do appropriate PUTBACK and SPAGAIN's before calling
matcher_matches_sv() (which pushes an arg an calls pp_match()).
If the stack was almost full, the extra push in matcher_matches_sv()
could cause a stack realloc, which would then be ignored when
pp_smartmatch() returned, setting PL_stack_sp to point to the old (freed)
stack.
Adding SPAGAIN ensures that PL_stack_sp points to the new stack, while
PUTBACK causes PL_stack_sp to no longer see the two args to pp_smartmatch,
so the PUSH in matcher_matches_sv() pushes the SV us9ng ones of two two
reclaimed slots, so the stack won't re-alloc anyway.
Thus by doing the "right thing" with both PUTBACK and SPAGAIN, we
doubly ensure that PL_stack_sp will always be right.
Tony Cook [Thu, 19 Feb 2015 04:03:58 +0000 (15:03 +1100)]
update PL_stack_sp when we exit matcher_matches_sv()
Tony Cook [Thu, 19 Feb 2015 04:02:49 +0000 (15:02 +1100)]
TODO test for smartmatch stack issue
David Mitchell [Wed, 11 Mar 2015 12:25:58 +0000 (12:25 +0000)]
repeat op: avoid integer overflows
For the list variant of the x operator, the overflow detection code
doesn't always work, resulting in the stack not being extended enough.
There are two places where an overflow could occur: calculating how
many stack items to extend by (items * count), and passing to repeatcpy()
how many bytes to copy 'items' SV pointers (items * sizeof(const SV *)).
The overflow detection was generally a mess; checking for overflow
using a value (max) that may have already overflown; checking whether
'max' had overflown incorrectly, and not checking (items * sizeof(const SV
*) at all (perhaps hoping that the other checks would be a superset of
this).
Also, some of the vars were still I32s; promote to 64-bit capable types.
Finally, the signature of Perl_repeatcpy() still has an I32 len;
that really should be changed to IV at some point; but for now I've just
ensured that the callers (list 'x' and scalar 'x') don't wrap.
I haven't put in a check for the only other core caller of repeatcpy(),
S_study_chunk(), since that would only become an issue compiling a pattern
with a fixed or floating substr within it of length > 2**31.
David Mitchell [Thu, 19 Mar 2015 11:04:01 +0000 (11:04 +0000)]
op.c: rename CHANGE_TYPE() to OpTYPE_set()
This macro is private to op.c, and has an overly generic name.
David Mitchell [Thu, 19 Mar 2015 10:02:00 +0000 (10:02 +0000)]
universal.c: remove all trace of op_sibling
The OpSIBLING() macro and op_sibling_splice() are a higher-level
way of manipulating optrees that ensure portability in the face of
PERL_OP_PARENT etc.
This commit also helps with the lofty goal of nothing outside of op.c
directly accessing the op_sibling field.
This is a follow-on/improvement to
bac7a184cda7b.
David Mitchell [Thu, 19 Mar 2015 09:49:14 +0000 (09:49 +0000)]
perlguts: clarify op_sibling usage
Father Chrysostomos [Thu, 19 Mar 2015 04:56:46 +0000 (21:56 -0700)]
universal.c: PERL_OP_PARENT support
Father Chrysostomos [Wed, 18 Mar 2015 09:35:50 +0000 (02:35 -0700)]
[perl #123995] Assert fail with s;@{<<;
If s;; gobbles up the implicit semicolon that is tacked on to the end
of the file, it can confuse the here-doc parser into thinking it is
inside a string eval, because there is no file handle. We need to
check for that possibility where the assertion was failing.
Karl Williamson [Tue, 17 Mar 2015 23:28:24 +0000 (17:28 -0600)]
regcomp.c: White-space only
Outdent code that the previous commit removed the surrounding block from
Karl Williamson [Tue, 17 Mar 2015 04:38:20 +0000 (22:38 -0600)]
Fix qr'\N{U+41}' on EBCDIC platforms
Prior to this commit, the regex compiler was relying on the lexer to do
the translation from Unicode to native for \N{...} constructs, where it
was simpler to do. However, when the pattern is a single-quoted string,
it is passed unchanged to the regex compiler, and did not work. Fixing
it required some refactoring, though it led to a clean API in a static
function.
This was spotted by Father Chrysostomos.