This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
9 years agopp.c:pp_i_negate: No PUTBACK necessary
Father Chrysostomos [Mon, 29 Dec 2014 01:36:51 +0000 (17:36 -0800)]
pp.c:pp_i_negate: No PUTBACK necessary

We don’t manipulate the stack pointer here.

9 years agopp.c:pp_complement: No PUTBACK necessary
Father Chrysostomos [Mon, 29 Dec 2014 01:33:45 +0000 (17:33 -0800)]
pp.c:pp_complement: No PUTBACK necessary

We don’t manipulate the stack pointer here.

9 years agopp.c:pp_undef: Less stack fiddling
Father Chrysostomos [Mon, 29 Dec 2014 01:19:07 +0000 (17:19 -0800)]
pp.c:pp_undef: Less stack fiddling

Only when called with no arguments does it need to manipulate the
stack pointer.

9 years agopp.c: pp_schop does not need PUTBACK
Father Chrysostomos [Mon, 29 Dec 2014 01:15:26 +0000 (17:15 -0800)]
pp.c: pp_schop does not need PUTBACK

as it does no stack manipulation.

9 years agopp.c:pp_trans: Remove targ variable
Father Chrysostomos [Mon, 29 Dec 2014 01:12:26 +0000 (17:12 -0800)]
pp.c:pp_trans: Remove targ variable

One spot was doing sv = GETTARG, which is equivalent to
sv = targ = ....  The value of targ was unused.  Elsewhere, a new mor-
tal was assigned to targ and then immediately pushed on to the stack.

Avoiding the redundant variable altogether results in smaller
machine code.

9 years agoFix bad write in pp_trans
Father Chrysostomos [Mon, 29 Dec 2014 01:07:47 +0000 (17:07 -0800)]
Fix bad write in pp_trans

y/// has not been extending the stack for lexical $_, even since lex-
ical $_ was added.  $lexical =~ y/// has not been extending the stack
since v5.21.5-339-g05a502d.

9 years agopp.c:pp_study: Less stack fiddling
Father Chrysostomos [Mon, 29 Dec 2014 00:55:33 +0000 (16:55 -0800)]
pp.c:pp_study: Less stack fiddling

We always pop and push exactly one item.  We can skip the sp++ and
sp--, and also the PUTBACK.

9 years agopp.c:pp_gelem: Less stack fiddling
Father Chrysostomos [Mon, 29 Dec 2014 00:53:42 +0000 (16:53 -0800)]
pp.c:pp_gelem: Less stack fiddling

Instead of pop, pop, push, just do one pop and then replace the
remaining item.  Also, there is no need to extend the stack here, as
pp_gelem returns fewer items than it consumes.

9 years agoRemove ‘require Config’ from ref.t
Father Chrysostomos [Mon, 29 Dec 2014 00:44:56 +0000 (16:44 -0800)]
Remove ‘require Config’ from ref.t

82b84d04879 removed the code that needed it.

9 years agoperlfunc: prototype implies $_
Father Chrysostomos [Mon, 29 Dec 2014 00:09:12 +0000 (16:09 -0800)]
perlfunc: prototype implies $_

9 years ago[perl #123514] Make prototype() imply $_
Father Chrysostomos [Mon, 29 Dec 2014 00:08:19 +0000 (16:08 -0800)]
[perl #123514] Make prototype() imply $_

Previously it would read and replace the previous item on the stack:

$ ./perl -le 'print "CORE::undef", prototype'
;\[$@%&*]

9 years agoDon’t write beyond the stack with scalar \()
Father Chrysostomos [Sun, 28 Dec 2014 23:56:23 +0000 (15:56 -0800)]
Don’t write beyond the stack with scalar \()

9 years agopp.c:pp_srefgen: Remove PUTBACK
Father Chrysostomos [Sun, 28 Dec 2014 22:30:31 +0000 (14:30 -0800)]
pp.c:pp_srefgen: Remove PUTBACK

We don’t manipulate the stack pointer at all here.

9 years agopp.c:pp_rv2cv: Remove PUTBACK
Father Chrysostomos [Sun, 28 Dec 2014 21:57:57 +0000 (13:57 -0800)]
pp.c:pp_rv2cv: Remove PUTBACK

pp_rv2cv doesn’t adjust the stack pointer at all, so there is no need
to synchronise with the global pointer before returning.

9 years agopp.c:pp_pos: Less stack fiddling
Father Chrysostomos [Sun, 28 Dec 2014 21:54:41 +0000 (13:54 -0800)]
pp.c:pp_pos: Less stack fiddling

We always pop exactly one item off the stack and then push exactly one
item.  Instead of doing sp-- and sp++, just leave it alone (TOP/SET,
rather than POP/PUSH).  Also skip PUTBACK, which is unnecessary.

9 years agopp.c:pp_rv2sv: Use >= instead of switch
Father Chrysostomos [Sun, 28 Dec 2014 21:46:26 +0000 (13:46 -0800)]
pp.c:pp_rv2sv: Use >= instead of switch

This results in smaller machine code.

If a freed SV is exposed to perl space then ${\$freed} will now die,
which is arguably more correct.

9 years agopp.c:pp_rand: Only EXTEND when not popping
Father Chrysostomos [Sun, 28 Dec 2014 21:03:56 +0000 (13:03 -0800)]
pp.c:pp_rand: Only EXTEND when not popping

9 years agoRemove inactive CUSTOMIZED entry.
James E Keenan [Sun, 28 Dec 2014 14:42:00 +0000 (09:42 -0500)]
Remove inactive CUSTOMIZED entry.

9 years agoAdd tests for stringification of regexps containing /n
Matthew Horsfall [Wed, 17 Dec 2014 21:28:34 +0000 (16:28 -0500)]
Add tests for stringification of regexps containing /n

9 years agoBump re.pm version for changes
Matthew Horsfall [Wed, 17 Dec 2014 21:20:46 +0000 (16:20 -0500)]
Bump re.pm version for changes

9 years agoSupport for nocapture regexp flag /n
Matthew Horsfall (alh) [Thu, 23 Oct 2014 00:56:47 +0000 (20:56 -0400)]
Support for nocapture regexp flag /n

This flag will prevent () from capturing and filling in $1, $2, etc...

Named captures will still work though, and if used will cause $1, $2, etc...
to be filled in *only* within named groups.

The motivation behind this is to allow the common construct of:

  /(?:b|c)a(?:t|n)/

To be rewritten more cleanly as:

  /(b|c)a(t|n)/n

When you want grouping but no memory penalty on captures.

You can also use ?n inside of a () directly to avoid capturing, and
?-n inside of a () to negate its effects if you want to capture.

9 years agoFixes to make test pass for regexp nocapture bit addition.
Matthew Horsfall (alh) [Thu, 23 Oct 2014 00:50:13 +0000 (20:50 -0400)]
Fixes to make test pass for regexp nocapture bit addition.

 * Make Devel-Peek/t/Peek.t less sensitive to regexp flag changes.

   Devel-Peek had flag names and binary representation hardcoded. Flag
   names *should* be enough. Otherwise we have to update bits of this
   test every time we muck with flags that don't affect the flags being
   tested.

 * Let B::Deparse know about the new RXf_PMf_CHARSET shift value.

9 years agoCreate bit for /n.
Karl Williamson [Wed, 22 Oct 2014 18:38:20 +0000 (12:38 -0600)]
Create bit for /n.

9 years agoFix various "CPAN only" warnings for cpan/ modules in Porting/Maintainers.pl
Steve Hay [Sun, 28 Dec 2014 14:26:04 +0000 (14:26 +0000)]
Fix various "CPAN only" warnings for cpan/ modules in Porting/Maintainers.pl

9 years agoNote that threads is currently customized in blead
Steve Hay [Sun, 28 Dec 2014 13:29:06 +0000 (13:29 +0000)]
Note that threads is currently customized in blead

9 years agopp_hot.c:pp_concat: Remove SvGETMAGIC
Father Chrysostomos [Sun, 28 Dec 2014 07:24:44 +0000 (23:24 -0800)]
pp_hot.c:pp_concat: Remove SvGETMAGIC

If the operand is magical, try_amagic_bin will already have copied
the operand if both left and right were the same, so left == right
will no longer be true by the time this path is reached.  This has
been the case since v5.13.11-400-g75ea7a1.

9 years agopp_hot.c:pp_concat: Remove PUTBACK/SPAGAIN
Father Chrysostomos [Sun, 28 Dec 2014 07:10:39 +0000 (23:10 -0800)]
pp_hot.c:pp_concat: Remove PUTBACK/SPAGAIN

sv_utf8_upgrade_nomg does not reallocate the stack, as of
v5.19.6-25-g7a3f960.

9 years agoUse gmtime’s target
Father Chrysostomos [Sun, 28 Dec 2014 06:53:55 +0000 (22:53 -0800)]
Use gmtime’s target

gmtime has a target allocated for it, but it hasn’t used that target
since 46fc3d4c6 (inseparable changes from match from perl-5.003_97g to
perl-5.003_97h, probably the ‘Mondo Cool patch’ mentioned in the com-
mit message).

There is no reason not to use it and avoid allocating a fresh SV with
each scalar-context call.

9 years agopp_sys.c:pp_gmtime: Remove redundant EXTEND_MORTAL
Father Chrysostomos [Sun, 28 Dec 2014 06:35:20 +0000 (22:35 -0800)]
pp_sys.c:pp_gmtime: Remove redundant EXTEND_MORTAL

The purpose of EXTEND_MORTAL is to extend the mortals stack only
once before pushing multiple items.  Here we are just going to push
one item, so extending it gains us nothing, as sv_2mortal is going
to do that anyway.

Moreover, we will not even be using the mortals stack if there has
been an error.

9 years agoop.c: Remove assert exception for OP_REPEAT
Father Chrysostomos [Sun, 28 Dec 2014 01:20:48 +0000 (17:20 -0800)]
op.c: Remove assert exception for OP_REPEAT

I changed the op tree in v5.21.5-101-g5e46266.

9 years agoop.h: Parenthesize macro args for cUNOPx etc.
Father Chrysostomos [Sun, 28 Dec 2014 01:18:52 +0000 (17:18 -0800)]
op.h: Parenthesize macro args for cUNOPx etc.

Without this, we cannot do cUNOPx(complex expression) without worrying
about precedence issues.

9 years agoperlop: Mention ~ among ops that vary by type
Father Chrysostomos [Sat, 27 Dec 2014 20:40:55 +0000 (12:40 -0800)]
perlop: Mention ~ among ops that vary by type

9 years agoconst the PerlIO vtables
Daniel Dragan [Thu, 25 Dec 2014 22:50:23 +0000 (17:50 -0500)]
const the PerlIO vtables

Previously the PerlIO vtables were const only on PERL_GLOBAL_STRUCT_PRIVATE
builds, which was created for former Symbian port and today is rarely used.
Since writing/hooking the PerlIO vtables from XS has never been public API
and is very unlikely to be occuring on CPAN, make then const so they will
be shared between perl processes.

b4 VC2008 x64 perl521.dll .rdata section 0x7293C bytes, .data 0x34B0 bytes
after .rdata 0x7321C .data 0x2BD0

9 years agoUpdate autodie to CPAN version 2.26
Chris 'BinGOs' Williams [Sat, 27 Dec 2014 16:19:50 +0000 (16:19 +0000)]
Update autodie to CPAN version 2.26

  [DELTA]

2.26      2014-12-26 16:27:23+00:00 UTC

        * BUGFIX / INCOMPAT: Remove "fileno" and "umask" from the list of
                             CORE subs protected by autodie and Fatal.
                             When they return undef, it is not a failure.

        * BUGFIX: Fixed an error that could occur during global destruction of
          the form "(in cleanup) Can't use an undefined value as an ARRAY
          reference at .../autodie/Scope/GuardStack.pm line 48 during global
          destruction" (Thanks to Dave Rolsky).

        * BUGFIX: The open-pragma is now properly ignored when open is
                  given an explicit layer.  This brings autodie protected
                  open in sync with open.  Thanks to Gregory Oschwald and
                  Graham Knop for the report + test case and the patch.
                  (GH#52 + GH#53)

        * BUGFIX: Hide the "SCALAR" (buffer) argument in the string
                  representation of autodie::exception for the read,
                  sysread and syswrite CORE subs.  This is to avoid
                  a dump of binary data to the screen/log when a
                  (sys)read or syswrite fails.

        * FEATURE: Let autodie::exception work in equality tests and
                   string comparison via "overload fallback".
                   (Thanks to Michael G. Schwern)

        * DOC: Mention that "kill" is in the ":ipc" category.  It has
               been there since autodie v2.14.
               (Thanks to Felipe Gasper for reporting it, RT#97320).

        * INTERNAL: Use "parent" instead of "base" for inheritance.  Also
                    avoid some @ISA relationships that were redundant.
                    Either truly redundant ones or by importing "import"
                    from Exporter v5.57.
                    -  This change implies that perl 5.8 users must now
                       also fetch "parent" from cpan.
                    (Thanks to Olivier Mengué, GH#59)

        * DEVEL / TEST: The autodie module now accepts an undefined Fatal
                        version, assuming it to be development version.
                        Test cases that require versions are now either
                        skipped or considered "release" test.

        * TEST / INTERNAL: Enabled travis-ci for Perl 5.20

        * TEST: Close temp file before re-opening in t/truncate.t.
                (Thanks to Craig A. Berry, RT#96609)

        * TEST: Pass O_TRUNC with O_CREAT to sysopen in t/utf8_open.t.
                (Thanks to Craig A. Berry, RT#87237)

        * TEST: Clean up temp file in t/truncate.t.
                (Thanks to Dave Mitchell, RT#100688)

9 years agoUpdate ExtUtils-Command to CPAN version 1.19
Chris 'BinGOs' Williams [Sat, 27 Dec 2014 15:23:08 +0000 (15:23 +0000)]
Update ExtUtils-Command to CPAN version 1.19

9 years agoperlfunc: another alternative for enabling the "state" feature
Slaven Rezic [Fri, 26 Dec 2014 20:21:03 +0000 (21:21 +0100)]
perlfunc: another alternative for enabling the "state" feature

9 years agooptimize CLEAR_ERRSV
Daniel Dragan [Fri, 26 Dec 2014 14:15:23 +0000 (09:15 -0500)]
optimize CLEAR_ERRSV

-gv_add_by_type is special only for non-GVs, and add AV to GV, otherwise
it is just assigning to GP slot (in this case through GvSV), which
CLEAR_ERRSV already did in another branch, so inline the gv_add_by_type
-dont compute GvSV multiple times, GvSV contains 2 derefs, after this patch
it will contains just 1 deref ("*svp") without an offset (deref without
offset is smaller in x86 machine code than deref with offset)
-SvREFCNT_dec_NN for efficiency
-move SvPOK_only closer to SvMAGICAL, this ensures SvFLAGS is read and
written only once, not 2 reads and 1 write, this is specifically for
RISC-ish cpus
-the goto clresv_newemptypv is because VC optimizer in -O1 didn't combine
the branches

perl521.dll VC 2003 before .text section size in machine code bytes
0xc8a63, after 0xc88e3

9 years agowin32/win32.c Perl_croak->croak_xs_usage
Daniel Dragan [Fri, 26 Dec 2014 03:07:07 +0000 (22:07 -0500)]
win32/win32.c Perl_croak->croak_xs_usage

When this XSUB was written croak_xs_usage didn't exist. Now it does. Use it
so the error string is shorter in the perl binary.

9 years agoconst the core magic vtables
Daniel Dragan [Thu, 25 Dec 2014 19:43:14 +0000 (14:43 -0500)]
const the core magic vtables

A remark in
http://www.nntp.perl.org/group/perl.perl5.porters/2006/07/msg115113.html
caused commit bc028b6b7f /
http://www.nntp.perl.org/group/perl.perl5.porters/2006/07/msg115116.html .
That remark is not true according to
http://www.nntp.perl.org/group/perl.perl5.porters/2006/07/msg115115.html
and
http://www.nntp.perl.org/group/perl.perl5.porters/2013/01/msg197318.html .
To save memory between perl processes, const the tables so the memory is
shared by the OS between perl processes.

b4 .rdata section of x64 VC 2008 miniperl 0x667EE bytes .data 0x3440 bytes
after .rdata 0x66FAE .data 0x2C80, 0x3440-0x2C80=0x7C0 saved,
based on the .data section size crossing a page boundary this saved 4K
of per process memory on Win64 miniperl.

9 years agodocument Perl_sv_getbackrefs() in perldelta
Yves Orton [Fri, 26 Dec 2014 15:26:46 +0000 (16:26 +0100)]
document Perl_sv_getbackrefs() in perldelta

9 years ago[perl #123502] isnan identifier can't be used as a var
Daniel Dragan [Fri, 26 Dec 2014 05:34:03 +0000 (00:34 -0500)]
[perl #123502] isnan identifier can't be used as a var

        cl -c -nologo -GF -W3 -I..\lib\CORE -I.\include -I. -I.. -DWIN32 -D_CONS
OLE -DNO_STRICT -DPERLDLL -DPERL_CORE -O1 -MD -Zi -DNDEBUG -G7 -GL -DPERL_EXTE
RNAL_GLOB -DPERL_IS_MINIPERL -Fo.\mini\pp_sys.obj ..\pp_sys.c
pp_sys.c
..\pp_sys.c(4610) : error C2063: '_isnan' : not a function
NMAKE : fatal error U1077: 'cl' : return code '0x2'

See RT ticket for details.

9 years agoperl5220delta: B::Generate is fixed
Father Chrysostomos [Thu, 25 Dec 2014 20:46:01 +0000 (12:46 -0800)]
perl5220delta: B::Generate is fixed

9 years ago[perl #123495] Stop gmtime(nan) from crashing
Father Chrysostomos [Thu, 25 Dec 2014 17:57:07 +0000 (09:57 -0800)]
[perl #123495] Stop gmtime(nan) from crashing

We were getting a time struct like this:

$12 = {
  tm_sec = -2147483588,
  tm_min = 2147483647,
  tm_hour = -2147483624,
  tm_mday = -2147483647,
  tm_mon = 11,
  tm_year = 69,
  tm_wday = -2147483641,
  tm_yday = -2147483314,
  tm_isdst = 0,
  tm_gmtoff = 0,
  tm_zone = 0x1004f6bb6 "UTC"
}

which resulted in dayname[tmbuf.tm_wday] reading past the beginning
of the array.  We should check for nan explicitly instead of falling
through to the time calculations.

9 years agoautomatically sort the MANIFEST if necessary
Yves Orton [Thu, 25 Dec 2014 14:44:14 +0000 (15:44 +0100)]
automatically sort the MANIFEST if necessary

Instead of harrasing people to sort the manifest in our
tests, we can just automatically sort the manifest when it
changes.

That way the tests are actually testing that the auto-sort
worked, and not that our devs put the new file in the right
place.

9 years agoadd cast to make c++ happy
Yves Orton [Thu, 25 Dec 2014 02:53:31 +0000 (03:53 +0100)]
add cast to make c++ happy

9 years agoRevert "dont compile unused static hash functions"
Yves Orton [Thu, 25 Dec 2014 02:29:57 +0000 (03:29 +0100)]
Revert "dont compile unused static hash functions"

This reverts commit 09c759bcfa4c2880c571df4da20458b2f781debf.

The reverted patch causes us to not compile functions that we might
not use. In theory this is a good thing. But any competent compiler
is going to exclude them anyway if they aren't used, and we might
miss useful warning messages, or whatnot. See b404539126a for an
example of a patch that would not have happened, or would only
have been partially done had this patch been applied.

Also the reverted patch claimed that "It is not safe to have multiple
hash funcs in 1 build due to conflicts on the size of
PERL_HASH_SEED_BYTES." which is incorrect. The functions do not
reference PERL_HASH_SEED_BYTES directly, and are usable by anyone
who knows what size of seed they need.

Additionally I have on my long-term todo list the following:

* Allow Perl to randomly select the hash function at startup
* Allow Perl to use the hash function determined by the ENV at startup.

This patch would have to be reverted to complete either of those tasks.

To recap, I am reverting this patch because it adds no real value,
makes our hash functions susceptible to bit-rot, and because it blocks
interesting future changes that I plan to work on in the future.

9 years agoRework sv_get_backrefs() so it is simpler, and C++ compliant
Yves Orton [Thu, 25 Dec 2014 02:24:23 +0000 (03:24 +0100)]
Rework sv_get_backrefs() so it is simpler, and C++ compliant

We unroll hv_backreferences_p() in sv_get_backrefs() so the logic is simpler,
(we dont need a **SV for this function), and (hopefully) make it C++ compliant
at the same time.

9 years agoRestructure hv_backreferences_p() so assert makes sense
Yves Orton [Thu, 25 Dec 2014 02:21:47 +0000 (03:21 +0100)]
Restructure hv_backreferences_p() so assert makes sense

Prior to this patch the assert was meaningless as we would
use the argument before we asserted things about it.

This patch restructures the logic so we do the asserts first
and *then* use the argument.

9 years agoRevert "sv.c: Add cast to make C++ happy"
Yves Orton [Thu, 25 Dec 2014 02:19:42 +0000 (03:19 +0100)]
Revert "sv.c: Add cast to make C++ happy"

This reverts commit d49cfb746d789072c374f2403d477feb8017ce89.

Better patch coming.

9 years agosv.c: Add cast to make C++ happy
Father Chrysostomos [Thu, 25 Dec 2014 02:06:03 +0000 (18:06 -0800)]
sv.c: Add cast to make C++ happy

9 years agot/bigmem/subst.t: Delete bogus comment
Father Chrysostomos [Wed, 24 Dec 2014 04:19:45 +0000 (20:19 -0800)]
t/bigmem/subst.t: Delete bogus comment

Accidentally copied from regexp.t

9 years agofixups to make the porting tests happy
Yves Orton [Thu, 25 Dec 2014 01:49:17 +0000 (02:49 +0100)]
fixups to make the porting tests happy

9 years agosort manifest
Yves Orton [Thu, 25 Dec 2014 01:26:51 +0000 (02:26 +0100)]
sort manifest

Why do we test for something that can be trivially accomplished by a
make manisort?

This is just makework with no value.

9 years agoadd new API function sv_get_backrefs()
Yves Orton [Thu, 25 Dec 2014 00:33:42 +0000 (01:33 +0100)]
add new API function sv_get_backrefs()

This encapsulates the logic to extract the backrefs from a weak-referent.

Since sv_get_backrefs() can be used for a similar purposes as hv_backreferences_p()
we no longer need to export the later, and therefore this patch also reverts
ad2f46a793b4ade67d45ac0086ae62f6756c2752.

See perl #123473 for related discussion, and https://github.com/Sereal/Sereal/issues/73
for a practical example of why this API is required.

9 years agoPerl 5 on Haiku - libperl.so not found installing out of standard location
H.Merijn Brand [Wed, 24 Dec 2014 20:09:02 +0000 (21:09 +0100)]
Perl 5 on Haiku - libperl.so not found installing out of standard location

Patch by Leon, checked by Dan Collins

9 years agoRMG: Note that Porting/release_schedule.pod should be updated
Steve Hay [Wed, 24 Dec 2014 14:49:59 +0000 (14:49 +0000)]
RMG: Note that Porting/release_schedule.pod should be updated

9 years agoNote that 5.21.6 and 5.21.7 are released
Steve Hay [Wed, 24 Dec 2014 14:49:31 +0000 (14:49 +0000)]
Note that 5.21.6 and 5.21.7 are released

9 years agoFix link error in perl521.dll with MinGW/gcc -xc++
Steve Hay [Wed, 24 Dec 2014 13:50:55 +0000 (13:50 +0000)]
Fix link error in perl521.dll with MinGW/gcc -xc++

perl.exp:fake:(.edata+0x1214): undefined reference to `win32_async_check'

9 years agoFix compilation errors in globals.c with MinGW/gcc -xc++
Steve Hay [Wed, 24 Dec 2014 13:11:45 +0000 (13:11 +0000)]
Fix compilation errors in globals.c with MinGW/gcc -xc++

error: external linkage required for symbol 'PL_charclass' because of
'dllexport' attribute

and likewise for many other symbols declared EXTCONST.

9 years agoFix compilation errors in DynaLoader.c with MinGW/gcc -xc++
Steve Hay [Sat, 20 Dec 2014 13:08:37 +0000 (13:08 +0000)]
Fix compilation errors in DynaLoader.c with MinGW/gcc -xc++

error: invalid conversion from 'void*' to 'HMODULE'

9 years agoFix compilation errors in win32sck.c with MinGW/gcc -xc++
Steve Hay [Sat, 20 Dec 2014 13:06:41 +0000 (13:06 +0000)]
Fix compilation errors in win32sck.c with MinGW/gcc -xc++

error: invalid conversion from 'const timeval*' to 'PTIMEVAL'

9 years agoFix compilation errors in win32.c with MinGW/gcc -xc++
Steve Hay [Sat, 20 Dec 2014 13:05:30 +0000 (13:05 +0000)]
Fix compilation errors in win32.c with MinGW/gcc -xc++

In MinGW-w64 builds, there are warnings/errors like this (depending on the
compiler version used):

gcc-4.5.3:
warning: passing argument 2 of 'execv' from incompatible pointer type

gcc-4.8.0:
error: invalid conversion from 'const char* const*' to 'char* const*'

This happens because MinGW-w64's process.h declares execv/execvp's second
argument as 'char * const*' instead of 'const char * const*'.
The _execv/_execvp versions don't have this problem so use them instead.
MSDN says execv/execvp are deprecated POSIX functions; use the ISO C++
conformant _execv/_execvp instead anyway so it is not even worth sticking
with execv/execvp for those compilers (namely, MinGW and VC++) that have
the correct declarations.

Likewise with spawnv/spawnvp vs. _spawnv/_spawnvp.

9 years agoFix compilation errors in mg.c with MinGW/gcc -xc++
Steve Hay [Sat, 20 Dec 2014 13:02:23 +0000 (13:02 +0000)]
Fix compilation errors in mg.c with MinGW/gcc -xc++

error: 'sip' was not declared in this scope
error: 'uap' was not declared in this scope

9 years agoFix typos in two unrelated test descriptions
Aaron Crane [Wed, 24 Dec 2014 11:54:37 +0000 (11:54 +0000)]
Fix typos in two unrelated test descriptions

9 years agoUpdate IO-Compress to CPAN version 2.068
Chris 'BinGOs' Williams [Wed, 24 Dec 2014 10:04:10 +0000 (10:04 +0000)]
Update IO-Compress to CPAN version 2.068

  [DELTA]

  2.068 23 Dec 2014

      * Disable running of some of the slower test harnesses by default.
        COMPRESS_ZLIB_RUN_MOST needs set to run them. Make life more
        bearable on legacy platforms

9 years agoUpdate Compress-Raw-Zlib to CPAN version 2.068
Chris 'BinGOs' Williams [Wed, 24 Dec 2014 10:02:39 +0000 (10:02 +0000)]
Update Compress-Raw-Zlib to CPAN version 2.068

  [DELTA]

  2.068 10 Dec 2014

      * Silence more compiler warnings

      * Disable running of 07bufsize.y by default.
        COMPRESS_ZLIB_RUN_MOST needs set to run them. Makes life more
        bearable on legacy platforms

9 years agoUpdate Compress-Raw-Bzip2 to CPAN version 2.068
Chris 'BinGOs' Williams [Wed, 24 Dec 2014 10:01:53 +0000 (10:01 +0000)]
Update Compress-Raw-Bzip2 to CPAN version 2.068

  [DELTA]

  2.068 23 Dec 2014

      * No Changes

9 years agoUpdate CPAN-Meta-Requirements to CPAN version 2.131
Chris 'BinGOs' Williams [Wed, 24 Dec 2014 10:00:02 +0000 (10:00 +0000)]
Update CPAN-Meta-Requirements to CPAN version 2.131

  [DELTA]

2.131     2014-12-23 15:04:19-05:00 America/New_York

    [ENHANCEMENTS]

    - Merging Module => 0 into requirements is now optimized

    [PREREQS]

    - Scalar::Utils removed as a prerequisite

9 years agodeparse-skips.txt: comp/require.t passes
Father Chrysostomos [Wed, 24 Dec 2014 06:08:48 +0000 (22:08 -0800)]
deparse-skips.txt: comp/require.t passes

9 years agoFix deparsing of some unary-prototyped calls
Father Chrysostomos [Wed, 24 Dec 2014 06:07:16 +0000 (22:07 -0800)]
Fix deparsing of some unary-prototyped calls

This resulted in an infinite loop:

    sub optplus(;+) {}
    optplus($a < $b);

The prototypes ;$ _ ;_ had the wrong predecence, causing foo($a<$b) to
be deparsed wrongly, without the parentheses.

9 years agoFix deparsing of ‘my sub x; sub { sub x {...} }’
Father Chrysostomos [Wed, 24 Dec 2014 04:34:09 +0000 (20:34 -0800)]
Fix deparsing of ‘my sub x; sub { sub x {...} }’

The ‘x’ sub has a pad entry in the sub containing its initial decla-
ration and in the sub containing its body.  pad_subs simplistically
added subs found in pads to the list of subs to be deparsed.  So the
body of x was being deparsed twice.

So we need to check the OUTSIDE pointer in pad_subs in deciding
whether to add it to the list, so only the sub containing the body
definition pushes it on to the list.

Without using the pad ID, this test in Deparse.t ends up failing:

state sub sb2;
sub sb2 {
    sb2 ;
}

because the state sub’s OUTSIDE pointer points to the protosub of the
anonymous sub that Deparse.t wraps around the test, whereas it is a
clone of that anonymous sub that gets deparsed.  Pad IDs exist to
identify clones of the same original pad.

9 years ago[perl #103260] Fix s/// with long strings
Father Chrysostomos [Wed, 24 Dec 2014 04:12:06 +0000 (20:12 -0800)]
[perl #103260] Fix s/// with long strings

This is also the subject of perl #123071.

The iteration count was stored in an I32 and was overflowing.  If the
maximum number of iterations possible overflowed, then it would become
negative, and the substitution would fail immediately with ‘Substitu-
tion loop’.

I tried fixing this without increasing the size of the context
stack entries on 64-bit builds (by skipping the loop check for long
strings), but was unable to, because we have to return the number of
iterations, which was also stored as I32.  If we change just that one
to SSize_t, we get an I32-sized alignment hole, so we might as well
make maxiters a SSize_t as well, fixing the bug that way (the more
straightforward way).

9 years agoTest-Simple Version Bump, 1.301001_093 (RC13)
Chad Granum [Mon, 22 Dec 2014 15:39:38 +0000 (07:39 -0800)]
Test-Simple Version Bump, 1.301001_093 (RC13)

Add alternate email address for Chad Granum to Porting/checkAUTHORS.pl.

9 years agodont compile unused static hash functions
Daniel Dragan [Tue, 23 Dec 2014 09:18:19 +0000 (04:18 -0500)]
dont compile unused static hash functions

Perl uses only 1 hash func perl build. It is not safe to have multiple
hash funcs in 1 build due to conflicts on the size of PERL_HASH_SEED_BYTES.
No point in wasting CC's time to compile a static func which will always be
tossed by the CC at the end due to no references to the static has func,
or by the linker due to no references to the funcs. Related to
[perl #123483] .

9 years agosilence VC Win64 perl warnings in hv_func.h
Daniel Dragan [Tue, 23 Dec 2014 05:35:24 +0000 (00:35 -0500)]
silence VC Win64 perl warnings in hv_func.h

These warnings are in a public header, hv_func.h, so CPAN
XS builders will see 8 warnings with every .c file from
a CPAN XS module that they will compile. Silence the
warnings since headers should never warn unconditionally.

See [perl #123483] for details.

9 years agoremove obsolete B::CC code from t/harness
Daniel Dragan [Tue, 23 Dec 2014 08:09:53 +0000 (03:09 -0500)]
remove obsolete B::CC code from t/harness

from commit 56eca212f2 .  Seems to have been used for
B::CC testing, but the blacklist logic and $dhwrapper logic
were removed in commit de1254415f but this piece was
missed. Half the files in the list don't exist anymore.

9 years agoIncrease $B::VERSION to 1.55
Father Chrysostomos [Tue, 23 Dec 2014 16:47:25 +0000 (08:47 -0800)]
Increase $B::VERSION to 1.55

9 years agoSome B pad tests
Father Chrysostomos [Tue, 23 Dec 2014 16:46:32 +0000 (08:46 -0800)]
Some B pad tests

9 years agoAdd id and outid methods to B::PADLIST
Father Chrysostomos [Tue, 23 Dec 2014 06:32:35 +0000 (22:32 -0800)]
Add id and outid methods to B::PADLIST

We wants them.

9 years agoop.c: Another instance of STATIC_ASSERT_STMT
Father Chrysostomos [Tue, 23 Dec 2014 06:22:19 +0000 (22:22 -0800)]
op.c: Another instance of STATIC_ASSERT_STMT

No need to check this at run time on debugging builds.

9 years agoperl5220delta: Eval::WithLexicals is fixed
Father Chrysostomos [Tue, 23 Dec 2014 01:47:47 +0000 (17:47 -0800)]
perl5220delta: Eval::WithLexicals is fixed

That was quick.

9 years agoUpdate Filter::Util::Call to CPAN version 1.53
Chris 'BinGOs' Williams [Tue, 23 Dec 2014 14:45:04 +0000 (14:45 +0000)]
Update Filter::Util::Call to CPAN version 1.53

  [DELTA]

1.53 2014-12-20 rurban
----

  * Re-release caused by broken SIGNATURE, caused by broken ExtUtils::Makemaker distsignature rules.
    See https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/177

1.52 2014-12-19 rurban
----

  * Fix Filter::Util::Call regression from 1.50, for filter_add({}) or filter_add([]).
    This broke Switch, see RT #101004.

9 years agoUpdate DB_File to CPAN version 1.835
Chris 'BinGOs' Williams [Tue, 23 Dec 2014 14:03:54 +0000 (14:03 +0000)]
Update DB_File to CPAN version 1.835

  [DELTA]

1.835 23 Dec 2014

   * Silence more compiler warnings

9 years agoSome lexical sub deparsing fixes
Father Chrysostomos [Tue, 23 Dec 2014 03:02:18 +0000 (19:02 -0800)]
Some lexical sub deparsing fixes

Prototypes were being ignored.

$ ./perl -Ilib -mO=Deparse -XMfeature=lexical_subs -e 'my sub f(\$); f($f)'
use feature 'lexical_subs';
no warnings;
my sub f (\$);
f(\$f);          # <---- wrong; this is a compilation error
-e syntax OK

Self-referential subs (state sub b; state sub b { b }) were causing
infinite recursion.

9 years agodeparse-skips.txt: Note a couple skip reasons
Father Chrysostomos [Tue, 23 Dec 2014 00:15:57 +0000 (16:15 -0800)]
deparse-skips.txt: Note a couple skip reasons

9 years agodeparse-skips.txt: More passing tests
Father Chrysostomos [Tue, 23 Dec 2014 00:10:56 +0000 (16:10 -0800)]
deparse-skips.txt: More passing tests

9 years agoIncrease $B::Deparse::VERSION to 1.32
Father Chrysostomos [Mon, 22 Dec 2014 16:24:27 +0000 (08:24 -0800)]
Increase $B::Deparse::VERSION to 1.32

9 years agoDeparse: Avoid uninit warning from undef &sub
Father Chrysostomos [Mon, 22 Dec 2014 07:16:16 +0000 (23:16 -0800)]
Deparse: Avoid uninit warning from undef &sub

9 years agoFix long verbatim line in perlunicook
Father Chrysostomos [Mon, 22 Dec 2014 22:57:21 +0000 (14:57 -0800)]
Fix long verbatim line in perlunicook

9 years agoAdd Eval::WithLexicals to perl5220delta
Father Chrysostomos [Mon, 22 Dec 2014 22:42:18 +0000 (14:42 -0800)]
Add Eval::WithLexicals to perl5220delta

9 years agoAdd B::Generate to perl5220delta
Father Chrysostomos [Mon, 22 Dec 2014 07:04:19 +0000 (23:04 -0800)]
Add B::Generate to perl5220delta

9 years agoIgnore cx of padsv for padrange optimisation
Father Chrysostomos [Mon, 22 Dec 2014 06:43:56 +0000 (22:43 -0800)]
Ignore cx of padsv for padrange optimisation

Commit v5.21.6-352-gc46871e caused all padsv ops to be marked with
scalar context.  This prevented the padrange optimisation from happen-
ing with a combination of scalars and aggregates in list context.

Adjust the padrange algorithm to ignore the distinction between list
and scalar context.  We only do this optimisation when, even in list
context, each op will push just one thing on to the stack.  (That’s
why we check OPf_REF on padav and padhv.)  So the list/scalar distinc-
tion is irrelevant.

9 years agoMerge branch 'perlunicook' into blead
Ricardo Signes [Sun, 21 Dec 2014 23:52:15 +0000 (18:52 -0500)]
Merge branch 'perlunicook' into blead

9 years agoperlunicook: add trusted-to-exist links for perlunicook
Ricardo Signes [Sun, 21 Dec 2014 23:48:22 +0000 (18:48 -0500)]
perlunicook: add trusted-to-exist links for perlunicook

9 years agoperlunicook: remove empty list item
Ricardo Signes [Sun, 21 Dec 2014 23:41:35 +0000 (18:41 -0500)]
perlunicook: remove empty list item

9 years agoperlunicook: add it to build files and TOC
Ricardo Signes [Sun, 21 Dec 2014 23:37:06 +0000 (18:37 -0500)]
perlunicook: add it to build files and TOC

9 years agoperlunicook: add perlunicook to MANIFEST
Ricardo Signes [Sun, 21 Dec 2014 23:35:10 +0000 (18:35 -0500)]
perlunicook: add perlunicook to MANIFEST

9 years agoFixes for a few trivial typos
Rafael Garcia-Suarez [Thu, 8 Mar 2012 18:31:47 +0000 (19:31 +0100)]
Fixes for a few trivial typos

9 years agoTom Christiansen's Perl Unicode Cookbook 1st draft
Ricardo Signes [Tue, 6 Mar 2012 15:32:36 +0000 (10:32 -0500)]
Tom Christiansen's Perl Unicode Cookbook 1st draft

originally posted to perl5-porters as message-id
18479.1330388058@chthon

9 years agoregen pod issues
Father Chrysostomos [Sun, 21 Dec 2014 20:46:43 +0000 (12:46 -0800)]
regen pod issues