Father Chrysostomos [Thu, 15 Dec 2011 04:10:08 +0000 (20:10 -0800)]
Bring perldiag/‘Assigning non-zero to $[’ closer to reality
Or closer to what will imminently be its reality
Father Chrysostomos [Thu, 15 Dec 2011 02:10:49 +0000 (18:10 -0800)]
Restore ‘Assigning non-zero to $[’ to perldiag
This was removed by
b82b06b8ca32. The message is coming back soon, at
least under ‘use 5.016’....
Karl Williamson [Wed, 14 Dec 2011 17:13:14 +0000 (10:13 -0700)]
perldelta_template: revise text about incompatible changes
Karl Williamson [Wed, 14 Dec 2011 16:29:33 +0000 (09:29 -0700)]
utf8.c: Change prototypes of two functions
_to_uni_fold_flags() and _to_fold_latin1() now have their flags
parameter be a boolean. The name 'flags' is retained in case the usage
ever expands instead of calling it by the name of the only use this
currently has.
This is as a result of confusion between this and _to_ut8_fold_flags()
which does have more than one flag possibility.
Karl Williamson [Wed, 14 Dec 2011 05:10:53 +0000 (22:10 -0700)]
scope.c: Allow successful saving of PL_tainted
leave_scope() saves and restores PL_tainted upon entry and exit. This
means that any attempt to save this variable on the stack will fail, as
its unstacked value will overwrite the popped one.
To counteract this, we update our saved version with the popped value.
Karl Williamson [Wed, 14 Dec 2011 05:01:46 +0000 (22:01 -0700)]
pp.c: Changing case of utf8 strings under locale uses locale for < 255
As proposed on p5p and approved, this changes the functions uc(), lc(),
ucfirst(), and lcfirst() to respect locale for code points < 255; and
use Unicode semantics for those above 255. This results in better, but
not perfect results, as noted in the changed pods, and brings these
functions into line with how regular expression pattern matching already
works.
Karl Williamson [Wed, 14 Dec 2011 04:52:40 +0000 (21:52 -0700)]
utf8.c: White-space changes only
This indents previous lines that are now within new blocks
Karl Williamson [Wed, 14 Dec 2011 04:48:19 +0000 (21:48 -0700)]
utf8.c: Allow Changed behavior of utf8 under locale
This changes the 4 case changing functions to take extra parameters to
specify if the utf8 string is to be processed under locale rules when
the code points are < 256. The current functions are changed to macros
that call the new versions so that current behavior is unchanged.
An additional, static, function is created that makes sure that the
255/256 boundary is not crossed during the case change.
Karl Williamson [Wed, 14 Dec 2011 04:34:11 +0000 (21:34 -0700)]
utf8.c: Add comment
Karl Williamson [Wed, 14 Dec 2011 04:24:24 +0000 (21:24 -0700)]
locale.t: Prepare for adding more tests
This custom TAP output .t has hard-coded test numbers. Rather than
disturb those, I plan to add tests that come after all the current ones,
and this paves the way for that.
Karl Williamson [Wed, 14 Dec 2011 04:20:12 +0000 (21:20 -0700)]
locale.t: Add ability to output a message with 'ok'
locale.t uses its own custom TAP messages. This changes the 'ok' sub
to accept another parameter, a test description to add to the TAP line.
And it changes the taint functions to produce a generic one of these
David Golden [Thu, 15 Dec 2011 18:36:42 +0000 (13:36 -0500)]
Revise feature.pm documentation
David Golden [Thu, 15 Dec 2011 16:13:23 +0000 (11:13 -0500)]
core-cpan-diff: clarify phrasing of missing file warning
David Golden [Thu, 15 Dec 2011 14:35:53 +0000 (09:35 -0500)]
Fix Maintainers.pl and META.yml for removal of lib/version.t
John Peacock [Mon, 12 Dec 2011 17:57:11 +0000 (12:57 -0500)]
Merge CPAN version.pm tests into CORE.
It has become increasingly difficult to maintain the CPAN tests
and the CORE tests, so include the [subtly edited] CPAN tests
into the CORE code instead. NOTE: this also bumps $VERSION to
match the forthcoming CPAN release.
Signed-off-by: David Golden <dagolden@cpan.org>
Chris 'BinGOs' Williams [Wed, 14 Dec 2011 23:02:38 +0000 (23:02 +0000)]
Update threads to CPAN version 1.86
[DELTA]
1.86 Wed Dec 14 21:12:51 2011
- Fix for mingw-w64 build due to setjmp difference
Chris 'BinGOs' Williams [Wed, 14 Dec 2011 21:19:57 +0000 (21:19 +0000)]
Sync Module-CoreList MANIFEST file with what is on CPAN
David Golden [Wed, 14 Dec 2011 20:47:03 +0000 (15:47 -0500)]
Fix Module::Build entry in Maintainers.pl
Corrected path for CUSTOMIZED and updated the documentation of
CUSTOMIZED as a reminder for others.
David Golden [Wed, 14 Dec 2011 20:39:57 +0000 (15:39 -0500)]
Update Maintainers.pl to quiet DAGOLDEN core-cpan-diff warnings
Dave Rolsky [Wed, 14 Dec 2011 18:33:27 +0000 (12:33 -0600)]
Reformatted Maintainers.pl for whitespace and layout consistency
(12:16:39) autarch: can I just run perltidy on the whole file?
(12:16:59) rjbs: Yes.
(12:17:14) ***rjbs will take the heat, if there is any, unless you actually BREAK something. :-)
(12:17:30) rjbs: where something is not "my custom Maintainers.pl parser, written in 1995"
Dave Rolsky [Wed, 14 Dec 2011 18:12:49 +0000 (12:12 -0600)]
More files to exclude from the core-cpan-diff
Karl Williamson [Wed, 14 Dec 2011 17:09:57 +0000 (10:09 -0700)]
perlfunc: Document kill without list of processes
Karl Williamson [Wed, 14 Dec 2011 16:41:26 +0000 (09:41 -0700)]
perlsec: Fix example to localize $@.
Not doing this can cause hard-to-find bugs.
Karl Williamson [Wed, 14 Dec 2011 16:36:43 +0000 (09:36 -0700)]
op/taint.t: localize $@
This is so the subroutine's calling 'eval' won't affect things outside
it.
Karl Williamson [Wed, 14 Dec 2011 04:16:50 +0000 (21:16 -0700)]
locale.t: Don't destroy caller's $@
This bug was very hard for me to find. Leave the outside $@ untouched.
Karl Williamson [Wed, 14 Dec 2011 04:13:10 +0000 (21:13 -0700)]
perllocale: Don't mention /l modifier
The /l modifier really shouldn't be used explicitly. So remove this
mention of it. It is documented in perlre, with appropriate cautions
against its explicit use.
Karl Williamson [Wed, 14 Dec 2011 04:08:33 +0000 (21:08 -0700)]
perllocale: Nits
This adds a clarification, a couple grammar and typo fixes, and outdents
some verbatim sections to fit within 79 columns.
Karl Williamson [Thu, 8 Dec 2011 01:18:34 +0000 (18:18 -0700)]
charnames: Add %Carp::Internal entry
This will be useful in a future commit. charnames is about to be split
into two modules, one called by the other, and warnings::warn() would
otherwise return if warnings are enabled in the parent module.
Karl Williamson [Sun, 4 Dec 2011 04:37:48 +0000 (21:37 -0700)]
charnames and perlapi: pod nits
Karl Williamson [Sat, 1 Oct 2011 16:29:56 +0000 (10:29 -0600)]
charnames: "Add 'use re "/aa"'
This should add a slight performance improvement, and is usable since
all names are ASCII
Dave Rolsky [Wed, 14 Dec 2011 17:51:42 +0000 (11:51 -0600)]
Ignore all tests in xt/ or tests of the form t/release-.*
Chris 'BinGOs' Williams [Wed, 14 Dec 2011 12:11:09 +0000 (12:11 +0000)]
Normalise some of the module updates in perldelta
Chris 'BinGOs' Williams [Wed, 14 Dec 2011 12:09:12 +0000 (12:09 +0000)]
Update Digest-SHA to CPAN version 5.70
[DELTA]
5.70 Wed Dec 14 02:32:10 MST 2011
- added BITS mode to addfile method and shasum
-- partial-byte inputs now possible via files/STDIN
-- allows shasum to check all 8074 NIST Msg vectors
-- previously required special programming
Father Chrysostomos [Tue, 13 Dec 2011 22:40:20 +0000 (14:40 -0800)]
perldelta: Turn one-liner into a block of code
so the line isn’t too long.
Father Chrysostomos [Tue, 13 Dec 2011 17:40:22 +0000 (09:40 -0800)]
perldelta up to
1881532246
Steffen Mueller [Tue, 13 Dec 2011 17:21:52 +0000 (18:21 +0100)]
EU::ParseXS: Silence undefined-value-in-addition warning
Nothing serious, just happened sometimes when reporting line numbers for
errors. But warning during build process.
Chris 'BinGOs' Williams [Tue, 13 Dec 2011 18:06:55 +0000 (18:06 +0000)]
Update CPAN-Meta-YAML to CPAN version 0.005
[DELTA]
0.005 2011-12-13 12:57:24 EST5EDT
- Generated from ADAMK/YAML-Tiny-1.50.tar.gz
- Fix documentation to clarify that users are responsible for
UTF-8 encoding/decoding
Ævar Arnfjörð Bjarmason [Tue, 13 Dec 2011 14:43:12 +0000 (14:43 +0000)]
[RT #78266] Don't leak memory when accessing named captures that didn't match
Since 5.10 (probably
44a2ac759e) named captures have been leaking
memory when they're used, don't actually match, but are later
accessed. E.g.:
$ perl -wle 'for (1..10_000_000) { if ("foo" =~ /(foo|(?<capture>bar))?/) { my $capture = $+{capture} } } system "ps -o rss $$"'
RSS
238524
Here we match the "foo" branch of our regex, but since we've used a
name capture we'll end up running the code in
Perl_reg_named_buff_fetch, which allocates a newSVsv(&PL_sv_undef) but
never uses it unless it's trying to return an array.
Just change that code not to allocate scalars we don't plan to
return. With this fix we don't leak any memory since there's nothing
to leak anymore.
$ ./perl -Ilib -wle 'for (1..10_000_000) { if ("foo" =~ /(foo|(?<capture>bar))?/) { my $capture = $+{capture} } } system "ps -o rss $$"'
RSS
3528
This reverts commit
b28f4af8cf94eb18c0cfde71e9625081912499a8 ("Fix
allocating something in the first place is a better solution than
allocating it, not using it, and then freeing it.
Father Chrysostomos [Tue, 13 Dec 2011 17:30:07 +0000 (09:30 -0800)]
Add Johannes Plunien to AUTHORS
Johannes Plunien [Tue, 13 Dec 2011 08:29:47 +0000 (12:29 +0400)]
Add testcase for #78266.
Johannes Plunien [Tue, 13 Dec 2011 07:39:52 +0000 (11:39 +0400)]
Fix #78266: Memory leak with named regexp captures.
Father Chrysostomos [Tue, 13 Dec 2011 06:29:39 +0000 (22:29 -0800)]
Make scalar() propagate lvalueness
As mentioned in ticket #24346, scalar() should not change lvalueness.
The fact that it did was a side effect of the implementation and a
bug. foo(scalar substr(....)) should pass a substr lvalue to foo just
as it would without scalar() or with a $ prototype (which is meant to
be equivalent to scalar()).
This also makes it possible to force scalar context in list assignment
to lvalue subroutines, as in (foo(), scalar bar()) = @list.
Karl Williamson [Mon, 12 Dec 2011 16:21:40 +0000 (09:21 -0700)]
perldelta for is_utf8_string()
John Peacock [Sun, 11 Dec 2011 02:51:02 +0000 (21:51 -0500)]
Set all version object math ops to noop
Explicitly handle all math operations with version objects as noop
instead of letting Perl handle it magically with nomethod.
Signed-off-by: David Golden <dagolden@cpan.org>
David Mitchell [Mon, 12 Dec 2011 12:42:46 +0000 (12:42 +0000)]
fix make_patchnum.pl branch determination
A previous commit of mine,
9077509c9b9bc1871867a5fba4351b95c670298d,
tried to handle the case where the output of 'git branch' was
* (no branch)
blead
to stop it outputting a 'Use of uninitialized value' warning.
However, my "fix" broke in the case where multiple branches are listed
with the current not the first:
blead
* tmp1
tmp2
Hopefully this fixes it properly.
Father Chrysostomos [Mon, 12 Dec 2011 04:45:36 +0000 (20:45 -0800)]
perldelta for
e7d0a3fbd9 (tying PVMG COWs)
Father Chrysostomos [Mon, 12 Dec 2011 04:03:25 +0000 (20:03 -0800)]
perldelta up to
0ea03996e7
Chris 'BinGOs' Williams [Sun, 11 Dec 2011 09:42:07 +0000 (09:42 +0000)]
Update Socket to CPAN version 1.96
[DELTA]
1.96 CHANGES:
* Fix Socket.t to use ok() instead of is() where required - RT73039
* Complete rewrite of module docs; list all the constants and
functions, updated SYNOPSIS
* Added convenient Exporter tag :addrinfo for all the gai/gni-related
symbols
* Provide static synthesized newSVpvn_flags() replacement for older
Perls
* Implement getnameinfo() NIx_NOHOST and NIx_NOSERV extension flags
1.95 CHANGES:
* Implement the remaining AI_*, EAI_* and NI_* constants from
Socket::GetAddrInfo
* Declare configure-time dependency on ExtUtils::Constants 0.23 for
when building out of core
* Initial attempt at dual-life extraction from bleadperl
Craig A. Berry [Sun, 11 Dec 2011 00:51:49 +0000 (18:51 -0600)]
Remove explicit support for pre-7.0 VMS and pre-6.0 DEC C.
OpenVMS v7.0 was released in 1995. There have been no reports of
recent releases of Perl building on versions that far back, yet we
still have quite a bit of code that explicitly supports versions
*prior* to v7.0.
There is a similar story for DEC C v6.0. It was released in 1998,
and has been superceded by numerous subsequent versions. Yet the
VMS-specific code in the core is littered with workarounds and
hacks that defend against deficiencies in very old compiler
versions.
This code is for all practical purposes no longer maintained or
maintainable, so the best path forward seems to be to remove it.
Anyone able and willing to commit to long-term support of it
could argue for its restoration, assuming Perl 5.14.x is not
adequate.
Father Chrysostomos [Sun, 11 Dec 2011 00:36:03 +0000 (16:36 -0800)]
Remove local $_ from Exporter
This was added in commit
732bb7c2d4f.
The changes in that commit did not necessitate the addition of
local $_. So the localisation is wasting CPU cycles. Worse, it
causes bugs in 5.12 and earlier. (local $_ is always wrong if you
don’t control what is in $_ already, because it could be a read-only
tied variable.) Actually, it causes bugs in 5.14-15 still, because
it seems that the changes to ‘local $_’ still weren’t sufficient (it
still calls FETCH, but not STORE). That itself needs fixing, but that
should not obviate the need for this change, as Exporter has been liv-
ing a double life.
Father Chrysostomos [Sun, 11 Dec 2011 00:20:33 +0000 (16:20 -0800)]
Increase $Exporter::VERSION to 5.66
Chris 'BinGOs' Williams [Sat, 10 Dec 2011 20:45:47 +0000 (20:45 +0000)]
Update CPANPLUS to CPAN version 0.9113
[DELTA]
Changes for 0.9113 Fri Dec 9 16:05:07 2011
================================================
* Add more detail and reason for NA to NA reports
Karl Williamson [Sat, 10 Dec 2011 19:57:05 +0000 (12:57 -0700)]
perlguts: nits
This fixes a few typos, adds a few clarifications, and fixes too wide
verbatim lines
Tony Cook [Sat, 26 Nov 2011 03:10:22 +0000 (14:10 +1100)]
document run_multiple_progs
Tony Cook [Mon, 28 Nov 2011 11:57:34 +0000 (22:57 +1100)]
test for various fatal messages from op.c
Tony Cook [Sat, 26 Nov 2011 03:10:05 +0000 (14:10 +1100)]
refactor croak.t to be data driven (like warnings.t)
Father Chrysostomos [Fri, 9 Dec 2011 21:31:18 +0000 (13:31 -0800)]
Increase ExtUtils::Packlist::VERSION to 1.45
jkeenan [Fri, 9 Dec 2011 02:39:09 +0000 (21:39 -0500)]
Correct POD formatting error: '=back' should be within '=begin =end' block.
Father Chrysostomos [Fri, 9 Dec 2011 21:27:46 +0000 (13:27 -0800)]
Increase $I18N::LangTags::VERSION to 0.38
Alexandr Ciornii [Sun, 16 Oct 2011 00:25:07 +0000 (03:25 +0300)]
update link to ISO 639-2
John Peacock [Fri, 9 Dec 2011 01:55:37 +0000 (20:55 -0500)]
Update UNIVERSAL::VERSION POD to reflect reality.
This should have been done when version objects were originally
added to the core back in 5.10.0. Mea culpa.
[I bumped UNIVERSAL.pm version and added a perldelta entry. -- DG]
Signed-off-by: David Golden <dagolden@cpan.org>
John Peacock [Wed, 7 Dec 2011 02:00:36 +0000 (21:00 -0500)]
Sync up tests with upstream version.pm
Pull in the contents of t/coretests.pm (more or less) from the CPAN
release of version.pm.
Signed-off-by: David Golden <dagolden@cpan.org>
John Peacock [Wed, 7 Dec 2011 01:55:09 +0000 (20:55 -0500)]
Use syntax from perlguts for testing objects
The following paragraph is in perlguts.pod:
To check if you've got an object derived from a specific class you have
to write:
if (sv_isobject(sv) && sv_derived_from(sv, class)) { ... }
which does the right thing with magical things like tied scalars.
Signed-off-by: David Golden <dagolden@cpan.org>
John Peacock [Wed, 7 Dec 2011 01:52:11 +0000 (20:52 -0500)]
Revert
9bf41c1d to UNIVERSAL::VERSION
Return the previous behavior where CLASS->VERSION will return a
stringified version object of the contents of $CLASS::VERSION.
Signed-off-by: David Golden <dagolden@cpan.org>
David Golden [Fri, 9 Dec 2011 19:32:08 +0000 (14:32 -0500)]
Fix segfault on overloaded arithmetic assignment
Consider an arithmetic assignment operation of the form
$left += $right
A segfault was occuring in the case where $right is an overloaded object
but $left is not; and where $right does not override "+=" but does
provide a 'nomethod' override. Internally, Perl_amagic_call was
attempting to clone $left as if it were an overloaded object, causing the
segfault. This commit fixes the segfault by only cloning the left
operand when the left operand is the overloaded one.
Nicholas Clark [Thu, 8 Dec 2011 10:43:06 +0000 (11:43 +0100)]
Remove "support" for using malloc.c outside the perl core distribution.
It only ever worked properly in 5.005.
Commit
d720c4410d3a0730 from June 1998 is the first known version of malloc.c
that would compile stand alone, without needing a config.h
Commit
5bbd1ef51ee0ebfa from December 1998 will not compile by default,
but will if one provides suitable definitions of simple macros on the command
line.
Commit
427181846486e3aa from September 1999 will not compile with command
line flags alone.
12 years later, no-one has reported problems, so it's safe to remove this.
Nicholas Clark [Thu, 8 Dec 2011 10:12:25 +0000 (11:12 +0100)]
Remove commented-out "support" for perl's malloc with x2p.
In 1998 commit
30e2e4257067d5f8 stated
temporarily disable perl malloc for a2p until we clean up
conflicting malloc() declarations everywhere
and nothing has changed since. 13 years later, no-one has reported problems,
so it's safe to remove it.
Nicholas Clark [Thu, 8 Dec 2011 14:30:02 +0000 (15:30 +0100)]
perl.h can include embed.h in the same location on all operating systems.
Commit
22c35a8c2392967a (October 1988) added a #include "embed.h" later in
perl.h for when building with PERL_OBJECT defined. Commit
d18c61170a306915
(November 1988) added an effectively duplicate #include for all WIN32.
Commit
0cb9638729211ea7 (June 1999) corrected the made the earlier #include
in perl.h also conditional on !PERL_OBJECT (in addition to the
!PERL_FOR_X2P added by
22c35a8c2392967a), but it wasn't until commit
d18c61170a306915 (November 1999) that this changed this to !WIN32, and
embed.h was included exactly once by perl.h (as a2p never actually includes
perl.h).
Commit
acfe0abcedaf592f (August 2001) removed the PERL_OBJECT code from
perl.h, reducing the duplication somewhat, but commit
96e176bf068724d0
(October 2001) created analogous special case duplication for VMS, and
commit
27da23d53ccce622 (April 2005) for Symbian. Commit
eb8433b7af0f2e09
(March 2006) then neatly put the same #ifndef PERL_MAD code after all 4
locations that included embed.h and commit
b3f24c00097febc1 (April 2006)
made the same correction in all 4 places.
But, the daft part of all this is that there was no reason why Win32 was
special - every other operating system can build perl with embed.h included
later in perl.h
Hence the earlier 3 locations can be eliminated, and the was-just-Win32
location made unconditional.
Which saves some lines of code. But fewer lines than are in this commit
message.
Nicholas Clark [Thu, 8 Dec 2011 12:16:43 +0000 (13:16 +0100)]
perl.h doesn't need special cases for x2p, as x2p doesn't include it.
Commit
22c35a8c2392967a in October 1998 added an #if !defined(PERL_FOR_X2P)
guard to prevent perl.h from including embed.h when being used to compile
a2p. However, this was not needed even then, because embed.h only contains
pre-processor directives (mostly #define) related to tokens unused in a2p's
C code, so its continued inclusion would not have any effect. Moreover a2p
never actually included perl.h from its own code - only its copy of malloc.c
would include perl.h, and that only if perl was configured to use its own
malloc. But even x2p's use of malloc.c had been "temporarily disabled" by
commit
30e2e4257067d5f8 1 month earlier, so there was never a need for this.
Nicholas Clark [Fri, 9 Dec 2011 15:43:21 +0000 (16:43 +0100)]
Remove the obsolete code for NO_EMBED from sdbm.h
Support for NO_EMBED was removed by commit
22c35a8c2392967 in 1998.
Minitrue attempted to eliminate all mention of it in 2003 with commit
a0a44e237c19cc2b, but missed this code in sdbm.h
Steve Peters [Fri, 9 Dec 2011 14:56:51 +0000 (09:56 -0500)]
Update READMEs and Pod with the updated URLs at lists.perl.org
Shlomi Fish [Wed, 7 Dec 2011 17:36:39 +0000 (19:36 +0200)]
Made "c [line_num]" working again.
This is a bug-fix to
https://rt.perl.org/rt3//Public/Bug/Display.html?id=104820 .
Both the fix and a regression tests were added.
Father Chrysostomos [Fri, 9 Dec 2011 06:32:51 +0000 (22:32 -0800)]
perldelta up to
e08f19f5d07
Father Chrysostomos [Fri, 9 Dec 2011 06:21:51 +0000 (22:21 -0800)]
Test out-of-bounds warning with lv substr
Father Chrysostomos [Fri, 9 Dec 2011 06:15:31 +0000 (22:15 -0800)]
perldelta up to
a74fb2cdc8f
plus some later commits dealing with substr
Father Chrysostomos [Fri, 9 Dec 2011 04:45:21 +0000 (20:45 -0800)]
perldelta up to
611272bb8
Craig A. Berry [Fri, 9 Dec 2011 02:50:17 +0000 (20:50 -0600)]
stat() fix for write but not read permission on a directory.
9b9f19dadd2 missed one corner case where we do actually need to
stat the directory file and not just the name without the .DIR. If
we have write but not read access to the directory, then
stat('foo.DIR') succeeds but stat('foo') fails. So if the first
stat failed fileify and try again.
Father Chrysostomos [Fri, 9 Dec 2011 02:12:09 +0000 (18:12 -0800)]
perldelta up to
47a0660e68
Father Chrysostomos [Fri, 9 Dec 2011 01:51:36 +0000 (17:51 -0800)]
Father Chrysostomos [Fri, 9 Dec 2011 01:03:42 +0000 (17:03 -0800)]
perldelta up to
c70a25495
Father Chrysostomos [Fri, 9 Dec 2011 00:16:32 +0000 (16:16 -0800)]
Father Chrysostomos [Fri, 9 Dec 2011 00:13:11 +0000 (16:13 -0800)]
Retroactively add newCONSTSUB_flags to 5154delta
Father Chrysostomos [Thu, 8 Dec 2011 22:53:50 +0000 (14:53 -0800)]
[perl #97476] Deparse not() following the llafr
not() follows the looks-like-a-function rule, unlike its high-prece-
dence counterpart. So deparsing
not +($foo || die) && $baz
as
not ($foo || die) && $baz
is incorrect, as the && $baz part is no longer part of the argu-
ment to not().
Father Chrysostomos [Thu, 8 Dec 2011 22:35:27 +0000 (14:35 -0800)]
[perl #77172] Deparse &{&} as &{&}, not &&
&& is always tokenised as the logical-and operator, and never as the
&{&} subroutine. B::Deparse needs to know about this.
(Oddly enough, ** can be exponentiation or the *{*} glob.)
Father Chrysostomos [Thu, 8 Dec 2011 22:27:15 +0000 (14:27 -0800)]
More tests for deparsing warn()+1, etc.
Father Chrysostomos [Thu, 8 Dec 2011 21:16:48 +0000 (13:16 -0800)]
[perl #74740] Deparse -(f()) correctly
-(f()) was being deparsed as -f(), which is a filetest operator.
Extra parens are needed for negation if the child op deparses with a
single letter at the beginning.
Father Chrysostomos [Thu, 8 Dec 2011 21:09:39 +0000 (13:09 -0800)]
Don’t warn for open local *FH
There is this ancient ‘Precedence problem’ warning that warns for open
followed by a bareword and then an operator that would have made open
into a unary-precedence operator in Perl 4. It was not taking into
account that the bareword might be a Perl keyword. In that case it
shouldn’t be warning.
Father Chrysostomos [Thu, 8 Dec 2011 20:51:19 +0000 (12:51 -0800)]
Deparse pipe(local *FH, local *FH) correctly
This is a follow-up to commit
2462c3cca (bug #63558).
I made it work with the first argument, but forgot the second.
Father Chrysostomos [Thu, 8 Dec 2011 20:49:33 +0000 (12:49 -0800)]
Deparse (eof)+1 correctly
If the parentheses are omitted, it means eof(1).
To fix this, we surround the keyword with parentheses (if necessary
according to precedence) if it is an unop, because a final () has a
special meaning for some unops.
For listops, we use surrounding parentheses only if the llafr does
not apply. Otherwise we use a final ().
Father Chrysostomos [Thu, 8 Dec 2011 17:58:44 +0000 (09:58 -0800)]
[perl #63558] Deparse open local(*FH) correctly
open FH and open local(*FH) compile down to the same structure
(open *FH), but with a flag set on the rv2gv (*{}) op for the
local case.
B::Deparse was special-casing rv2gv for ops with * in their prototype,
but without consideration for the flag.
Father Chrysostomos [Thu, 8 Dec 2011 17:34:04 +0000 (09:34 -0800)]
Deparse dump as CORE::dump
Since dump() warns without CORE::, and since the two variants are
indistinguishable after compilation, always deparse dump() as
CORE::dump.
Father Chrysostomos [Thu, 8 Dec 2011 17:30:31 +0000 (09:30 -0800)]
Deparse filetest ops without llafr
Before this commit, (-e $_) + 72 deparsed incorrectly, because it
became -e($_) + 72, equivalent to -e ($_+72).
Concerning the removed comment, it’s more important to produce correct
code than nice-looking code.
Father Chrysostomos [Thu, 8 Dec 2011 16:42:31 +0000 (08:42 -0800)]
Fix use VERSION test failures under PERL_UNICODE
use VERSION now checks whether HINT_LOCALIZE_HH is set, which indi-
cates that %^H has been modified. If it is set, it does ‘no feature’
first, regardless of the version number.
Some tests were checking that feature.pm is not loaded for use 5.8.8.
Now it is sometimes, particularly if PERL_UNICODE has been set, as it
adds keys to %^H.
For now, I’ve tweaked the tests. It would be nice if version declara-
tions could load and unload features without loading feature.pm, just
as they do with strictures.
Father Chrysostomos [Thu, 8 Dec 2011 14:24:53 +0000 (06:24 -0800)]
Deparse CORE::do+{} and CORE::do({}) correctly
Commit
94bb57f91b missed the CORE:: variant.
Father Chrysostomos [Thu, 8 Dec 2011 06:13:50 +0000 (22:13 -0800)]
Fix deparsing of "" =~ <any OPf_SPECIAL op>
This is a regression in 5.14.
$ ./perl -Ilib -MO=Deparse -e '"" =~ do{}'
'' =~ ($_ =~ do {
()
});
-e syntax OK
Commit
a539498ab05 fixed the deparsing of "foo" =~ (1?/foo/:/bar/),
in which /foo/ is implicitly bound to $_. Due to constant folding,
the whole condition expression is reduced to "foo" =~ /foo/, but with
/foo/ still bound to $_. /foo/ is marked OPf_SPECIAL, which allows
us to distinguish the cases. The fix, which added "$_ =~" explic-
itly, did not check that the op was a match op, so any op on the rhs
with the OPf_SPECIAL flag set could trigger the same special case.
Father Chrysostomos [Thu, 8 Dec 2011 06:40:28 +0000 (22:40 -0800)]
Deparse.pm: More functions that do not follow llafr
See the previous commit.
Again, whether we apply the llafr to loop exits shouldn’t be about
whether parentheses look nice, but whether the final code parses
correctly.
Father Chrysostomos [Thu, 8 Dec 2011 05:58:27 +0000 (21:58 -0800)]
[perl #77096] Deparse return and do without llafr
‘return’ and ‘do-file’ are exempt from the ‘looks-like-a-function
rule’ (llafr).
B::Deparse was intentionally ignoring that:
While it might produce nice-looking code, the final code compiles dif-
ferently in many cases, so we simply cannot ignore these ops’ disre-
gard for that rule.
Father Chrysostomos [Wed, 7 Dec 2011 20:52:05 +0000 (12:52 -0800)]
deparse.t: Add bug number
Father Chrysostomos [Wed, 7 Dec 2011 20:41:56 +0000 (12:41 -0800)]
[perl #47361] Deparse do +{} and do({}) correctly
These are both variants of do-file syntax.
Nicholas Clark [Thu, 8 Dec 2011 13:02:39 +0000 (14:02 +0100)]
Correct a bug in the previous commit (
bb35dd48)
The test in bisect-runner.pl for when to apply the fix of commit
c955f1177b2e311d was not correct - it would also attempt to apply the patch
to commit
c955f1177b2e311d and later, not just to commits before
c955f1177b2e311d.