This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
11 years agoMake PL_compcv visible to BEGIN blocks
Father Chrysostomos [Wed, 26 Sep 2012 15:47:28 +0000 (08:47 -0700)]
Make PL_compcv visible to BEGIN blocks

This allows BEGIN { XS_func(); } to access the currently-com-
piling pad.

BEGIN blocks were unlike any other subroutine or special block in that
PL_compcv would be set to the BEGIN block itself at run time.

11 years ago[MERGE] make regex engine handle non-null-terminated strings
David Mitchell [Wed, 26 Sep 2012 09:13:03 +0000 (10:13 +0100)]
[MERGE] make regex engine handle non-null-terminated strings

11 years agostop regex engine reading beyond end of string
David Mitchell [Fri, 21 Sep 2012 09:29:04 +0000 (10:29 +0100)]
stop regex engine reading beyond end of string

Historically the regex engine has assumed that any string passed to it
will have a trailing null char. This isn't normally an issue in perl code,
since perl strings *are* null terminated; but it could cause problems with
strings returned by XS code, or with someone calling the regex engine
directly from XS, with strend not pointing at a null char.

The engine currently relies on there being a null char in the following
ways.

First, when at the end of string, the main loop of regmatch() still reads
in the 'next' character (i.e. the character following the end of string)
even if it doesn't make any use of it. This precludes using memory mapped
files as strings for example, since the read off the end would SEGV.

Second, the matching algorithm often required the trailing character to be
\0 to work correctly: the test for 'EOF' was "if next char is null *and*
locinput >= PL_regeol, then stop". So a random non-null trailing char
could cause an overshoot.

Thirdly, some match ops require the trailing char to be null to operate
correctly; for example, \b applied at the end of the string only happens
to work because the trailing char (\0) happens to match \W.

Also, some utf8 ops will try to extract the code point at the end, which
can result in multiple bytes past the end of string being read, and
possible problems if they don't correspond to well-formed utf8.

The main fix is in S_regmatch, where the 'read next char' code has been
updated to set it to a special value, NEXTCHR_EOS instead, if we would be
reading past the end of the string.

Lots of other random bits in the regex engine needed to be fixed up too.

To track these down, I temporarily hacked regexec_flags() to make a copy
of the string but without trailing \0, then ran all the t/re/*.t tests
under valgrind to flush out all buffer overruns. So I think I've removed
most of the bad code, but by no means all of it. The code within the
various functions in regexec.c is far too complex to be able to visually
audit the code with any confidence.

11 years agoregmatch(): fix typo in TRIE commentary text
David Mitchell [Sun, 16 Sep 2012 16:39:06 +0000 (17:39 +0100)]
regmatch(): fix typo in TRIE commentary text

11 years agoregmatch() annotate ops and separate out branches
David Mitchell [Sun, 16 Sep 2012 16:33:08 +0000 (17:33 +0100)]
regmatch() annotate ops and separate out branches

Annotate each 'case OP:' in the main switch in regmatch() to show
what regex pattern this implements. About half the ops had already been
done. Also add a blank line between each 'case' statement for readability.
(no code changes)

11 years agoregmatch(): do nextchr=*locinput at top of loop
David Mitchell [Fri, 14 Sep 2012 15:19:10 +0000 (16:19 +0100)]
regmatch(): do nextchr=*locinput at top of loop

Currently each branch in the main regmatch() loop is responsible
re-initialising nextchar to UCHARAT(locinput) if locinput is modified.

By adding
    nextchr = UCHARAT(locinput);
to the head of the loop, we can remove most of the nextchar assignments
in the individual branches. We lose slightly for the zero-width assertions
like \b which will re-read the same nextchar, but this will make it
easier to handle non-null-terminated strings.

11 years agoregmatch(): nextchar should always be positive
David Mitchell [Fri, 14 Sep 2012 14:46:47 +0000 (15:46 +0100)]
regmatch(): nextchar should always be positive

Remove the one bit of code that tests for < 0, and put in a
general assert.

11 years agoregmatch(): consolidate locinput++
David Mitchell [Fri, 14 Sep 2012 11:37:33 +0000 (12:37 +0100)]
regmatch(): consolidate locinput++

There are several places in the code that increment locinput by 1 char
(which may or may not be 1 byte) then update nextchr.

Consolidate these into a single code block with the others goto'ing it.
This actually reduces the code more than it appears, since the CCC_TRY*
macros expand into several branches, each of which repeatthe
increment code.

11 years agoregmatch(): use nextchar where available
David Mitchell [Fri, 14 Sep 2012 10:28:08 +0000 (11:28 +0100)]
regmatch(): use nextchar where available

In a couple of places the code was using *locinput, where
nextchar already equalled *locinput

11 years agoStop declaring non-exported externs to non-core XS modules [perl #114516]
Steve Hay [Wed, 26 Sep 2012 07:33:20 +0000 (08:33 +0100)]
Stop declaring non-exported externs to non-core XS modules [perl #114516]

Hide the perl.h declarations of gete?[ug]id and getlogin on Win32 since
they are already declared in win32/win32.h, nearer to their definitions
(stub functions for UNIX compatibility) in win32/win32.c.

Also only declare them, and kill(pg)?, sbrk, chown and mkstemp, under
PERL_CORE anyway since they are not exported: including declarations for
non-exported functions just hides compiler errors about the symbols being
undefined, which doesn't help when trying to fix subsequent errors from
the linker about the symbols being unresolved. (Actually, all but sbrk,
chown and mkstemp get indirected through the perlhost layer normally
anyway, but it doesn't hurt to still hide the declarations, and helps in
the case of PERL_IMPLICIT_SYS not being defined, where only kill is
redefined to something which is exported.)

The declarations of the set[ug]id stub functions remain for now because
those two symbols are currently exported.

11 years agoTest for errors requiring .ph files.
Paul Johnson [Wed, 26 Sep 2012 00:44:44 +0000 (02:44 +0200)]
Test for errors requiring .ph files.

11 years agoCorrect fm vtable in perlguts.pod
Father Chrysostomos [Tue, 25 Sep 2012 21:46:35 +0000 (14:46 -0700)]
Correct fm vtable in perlguts.pod

fm magic uses want_vtbl_fm, which is #defined as want_vtbl_regexp.
The definition in regen/mg_vtable.pl does not affect anything except
the documentation.  It was listed as using regdata which was wrong.

11 years agoRestore perly.o build with -DDEBUGGING
Father Chrysostomos [Wed, 26 Sep 2012 01:00:42 +0000 (18:00 -0700)]
Restore perly.o build with -DDEBUGGING

11 years agoAdd t/test_pl* to MANIFEST
Father Chrysostomos [Tue, 25 Sep 2012 21:16:13 +0000 (14:16 -0700)]
Add t/test_pl* to MANIFEST

Soon, we’ll be testing that these tests work. :-)

11 years agoMake t/test_pl/tempfile.t produce more diagnostics
Brad Gilbert [Tue, 25 Sep 2012 18:12:54 +0000 (13:12 -0500)]
Make t/test_pl/tempfile.t produce more diagnostics

11 years agoAdded t/test_pl/tempfile.t
Brad Gilbert [Sun, 16 Sep 2012 20:28:01 +0000 (15:28 -0500)]
Added t/test_pl/tempfile.t

11 years agoRework tempfile() in t/test.pl to use _num_to_alpha()
Brad Gilbert [Sun, 16 Sep 2012 20:23:36 +0000 (15:23 -0500)]
Rework tempfile() in t/test.pl to use _num_to_alpha()

11 years agoAdded test names to some tests in t/test_pl/_num_to_alpha.t
Brad Gilbert [Sun, 16 Sep 2012 20:15:02 +0000 (15:15 -0500)]
Added test names to some tests in t/test_pl/_num_to_alpha.t

11 years agoAdded optional char limit to _num_to_alpha() in test.pl
Brad Gilbert [Sun, 16 Sep 2012 19:25:19 +0000 (14:25 -0500)]
Added optional char limit to _num_to_alpha() in test.pl

11 years agoAdd _num_to_alpha() to test.pl
Brad Gilbert [Sun, 16 Sep 2012 19:06:59 +0000 (14:06 -0500)]
Add _num_to_alpha() to test.pl

Also added testing for _num_to_alpha()

11 years agoMove @letters in test.pl earlier
Brad Gilbert [Tue, 25 Sep 2012 16:39:45 +0000 (11:39 -0500)]
Move @letters in test.pl earlier

11 years agoapparently this actually needs to be regenerated too
Jesse Luehrs [Tue, 25 Sep 2012 15:04:00 +0000 (10:04 -0500)]
apparently this actually needs to be regenerated too

11 years agofix regen_perly.pl for bison 2.6
Jesse Luehrs [Tue, 25 Sep 2012 08:51:14 +0000 (03:51 -0500)]
fix regen_perly.pl for bison 2.6

11 years ago[perl #56880] Allow v10 as a label or package name
Father Chrysostomos [Tue, 25 Sep 2012 01:18:42 +0000 (18:18 -0700)]
[perl #56880] Allow v10 as a label or package name

11 years agoUpdate Digest-SHA to CPAN version 5.72
Chris 'BinGOs' Williams [Tue, 25 Sep 2012 08:46:42 +0000 (09:46 +0100)]
Update Digest-SHA to CPAN version 5.72

  [DELTA]

  5.72  Mon Sep 24 15:22:08 MST 2012
    - adjusted module installation directory for later Perls
      -- As of 5.11 Perl searches 'site' first, so use that
        -- ref. INSTALLDIRS in Makefile.PL
      -- thanks to Robert Sedlacek for patch

11 years ago[perl #77240] Don’t warn for --subname
Father Chrysostomos [Mon, 24 Sep 2012 23:24:54 +0000 (16:24 -0700)]
[perl #77240] Don’t warn for --subname

11 years ago[perl #77094] Stop printf +() from reading past SP
Father Chrysostomos [Mon, 24 Sep 2012 23:08:07 +0000 (16:08 -0700)]
[perl #77094] Stop printf +() from reading past SP

printf with an empty list was reading past the end of the stack and
using whatever it found as its format.  If given an empty list, it
should treat the format as "".

11 years agoDon’t crash with existent but undefined &DB::DB
Father Chrysostomos [Mon, 24 Sep 2012 15:46:56 +0000 (08:46 -0700)]
Don’t crash with existent but undefined &DB::DB

This is a follow-up to 432d4561c48, which fixed *DB::DB without
&DB::DB, but not &DB::DB without body.

11 years agoA better fix for leaking array assignment
Father Chrysostomos [Mon, 24 Sep 2012 06:56:40 +0000 (23:56 -0700)]
A better fix for leaking array assignment

Instead of filling up the mortals stack with as many SVs as there are
elements, just call get-magic before creating the new SV.

(This is not so easy for hashes, as we have keys as well, and
hv_common always calls get-magic on keys.)

See commits 9c744f4f4d7 and 39984de3a8, which fixed leaking bugs, but
inefficiently.

11 years agoFix C++ build
Father Chrysostomos [Mon, 24 Sep 2012 16:36:11 +0000 (09:36 -0700)]
Fix C++ build

11 years ago[perl #97958] Make reset "" match its docs
Father Chrysostomos [Mon, 24 Sep 2012 06:47:57 +0000 (23:47 -0700)]
[perl #97958] Make reset "" match its docs

According to the documentation, reset() with no argument resets pat-
terns.  But reset "" and reset "\0foo" were also resetting patterns.
While I was at it, I fixed embedded nulls, too, though it’s not likely
anyone is using this.  I could not fix the bug within the existing API
for sv_reset, so I created a new function and left the old one with
the old behaviour.  Call me pear-annoyed.

11 years agodon't crash with -d if DB::DB is seen but not defined [perl #114990]
Jesse Luehrs [Mon, 24 Sep 2012 05:29:06 +0000 (00:29 -0500)]
don't crash with -d if DB::DB is seen but not defined [perl #114990]

11 years ago[perl #107000] Don’t leak if hh copying dies
Father Chrysostomos [Sun, 23 Sep 2012 19:42:15 +0000 (12:42 -0700)]
[perl #107000] Don’t leak if hh copying dies

When %^H is copied on entering a new scope, if it happens to have been
tied it can die.  This was resulting in leaks, because no protections
were added to handle that case.

The two things that were leaking were the new hash in hv_copy_hints_hv
and the new value (for an element) in newSVsv.

By fixing newSVsv itself, this also fixes any potential leaks when
other pieces of code call newSVsv on explosive values.

11 years ago[perl #97466] Stop defined from propagating ref cx too far
Father Chrysostomos [Sun, 23 Sep 2012 13:02:58 +0000 (06:02 -0700)]
[perl #97466] Stop defined from propagating ref cx too far

11 years agoUpdate Unicode-Normalize to CPAN version 1.15
Chris 'BinGOs' Williams [Sun, 23 Sep 2012 10:03:28 +0000 (11:03 +0100)]
Update Unicode-Normalize to CPAN version 1.15

  [DELTA]

  1.15  Sun Sep 23 10:43:14 2012
      - perl 5.11.0 or later: Install to 'site' instead of 'perl'
        (see [rt.cpan.org #79801])

11 years agoUpdate Unicode-Collate to CPAN version 0.90
Chris 'BinGOs' Williams [Sun, 23 Sep 2012 10:01:23 +0000 (11:01 +0100)]
Update Unicode-Collate to CPAN version 0.90

  [DELTA]

  0.90  Sun Sep 23 10:42:26 2012
      - perl 5.11.0 or later: Install to 'site' instead of 'perl'
        (see [rt.cpan.org #79800])

11 years agoSync versions of Module-CoreList and Exporter in Maintainers.pl
Chris 'BinGOs' Williams [Sun, 23 Sep 2012 09:57:38 +0000 (10:57 +0100)]
Sync versions of Module-CoreList and Exporter in Maintainers.pl

11 years agoIncrease $B::Deparse::VERSION to 1.18
Father Chrysostomos [Sun, 23 Sep 2012 01:48:50 +0000 (18:48 -0700)]
Increase $B::Deparse::VERSION to 1.18

11 years ago[perl #94490] const fold should not trigger special split " "
Father Chrysostomos [Sun, 23 Sep 2012 00:54:12 +0000 (17:54 -0700)]
[perl #94490] const fold should not trigger special split " "

The easiest way to fix this was to move the special handling out of
the regexp engine.  Now a flag is set on the split op itself for
this case.  A real regexp is still created, as that is the most
convenient way to propagate locale settings, and it prevents the
need to rework pp_split to handle a null regexp.

This also means that custom regexp plugins no longer need to handle
split specially (which they all do currently).

11 years agoregexp.h: Correct comment
Father Chrysostomos [Sun, 23 Sep 2012 00:26:48 +0000 (17:26 -0700)]
regexp.h: Correct comment

RXf_SKIPWHITE is for split " ", which is special, *not* for split / /.

11 years agoStop array assignment from leaking on croak
Father Chrysostomos [Sat, 22 Sep 2012 19:06:45 +0000 (12:06 -0700)]
Stop array assignment from leaking on croak

This made a to-do test in sort.t pass, but adventitiously, so I modi-
fied it to fail again.

11 years agoStop hash assignment from leaking on croak
Father Chrysostomos [Sat, 22 Sep 2012 14:12:04 +0000 (07:12 -0700)]
Stop hash assignment from leaking on croak

11 years agoFree iterator when freeing tied hash
Father Chrysostomos [Sat, 22 Sep 2012 05:01:19 +0000 (22:01 -0700)]
Free iterator when freeing tied hash

The current iterator was leaking when a tied hash was freed or
undefined.

Since we already have a mechanism, namely HvLAZYDEL, for freeing
HvEITER when not referenced elsewhere, we can use that.

11 years agoDon’t leak deleted iterator when tying hash
Father Chrysostomos [Sat, 22 Sep 2012 01:23:20 +0000 (18:23 -0700)]
Don’t leak deleted iterator when tying hash

11 years agoOops. make regen
Father Chrysostomos [Sat, 22 Sep 2012 21:46:29 +0000 (14:46 -0700)]
Oops. make regen

11 years agoAdd a #! line to config_h.SH
Father Chrysostomos [Sat, 22 Sep 2012 20:17:20 +0000 (13:17 -0700)]
Add a #! line to config_h.SH

It will get one automatically the next time config_h.pl is run, but
that time hasn’t come yet. :-)

11 years agoadd to authors
Sawyer X [Sat, 22 Sep 2012 13:12:26 +0000 (16:12 +0300)]
add to authors

11 years agoadd shebangs where missing
Sawyer X [Sat, 22 Sep 2012 12:48:09 +0000 (15:48 +0300)]
add shebangs where missing

11 years agotest for files that have exec bit but no shebang
Sawyer X [Fri, 21 Sep 2012 00:44:38 +0000 (03:44 +0300)]
test for files that have exec bit but no shebang

11 years ago[perl #96230] Stop qr// from reusing last pattern
Father Chrysostomos [Sat, 22 Sep 2012 14:13:36 +0000 (07:13 -0700)]
[perl #96230] Stop qr// from reusing last pattern

qr// should not be using the last-successful pattern, because it is
"(?^:)", not the empty pattern.  A stringified qr// does not use the
last-successful pattern.

11 years agoLet qr.t run from the top level
Father Chrysostomos [Sat, 22 Sep 2012 05:44:00 +0000 (22:44 -0700)]
Let qr.t run from the top level

11 years agoqr.t: Load test.pl in BEGIN
Father Chrysostomos [Sat, 22 Sep 2012 05:43:34 +0000 (22:43 -0700)]
qr.t: Load test.pl in BEGIN

so lazy people like me can omit parentheses

11 years agohv.c: comment typo
Father Chrysostomos [Fri, 21 Sep 2012 04:31:15 +0000 (21:31 -0700)]
hv.c: comment typo

11 years agoAdd #!/bin/sh when re-ordering config_h.SH
H.Merijn Brand [Sat, 22 Sep 2012 09:59:25 +0000 (11:59 +0200)]
Add #!/bin/sh when re-ordering config_h.SH

Also add a small comment to indicate the use of this script

Based on
Subject: [PATCH] Giving config_h.SH a shebang via Porting/config_h.pl
From: Sawyer X <xsawyerx@gmail.com>
Date: Fri, 21 Sep 2012 21:15:43 +0300
Message-ID: <505CAECF.1060600@gmail.com>

11 years agoWe don't want statistics for every single blead release
Florian Ragwitz [Fri, 21 Sep 2012 14:50:15 +0000 (10:50 -0400)]
We don't want statistics for every single blead release

11 years agoThe repository is called perlweb
Florian Ragwitz [Thu, 20 Sep 2012 13:05:36 +0000 (09:05 -0400)]
The repository is called perlweb

11 years agoRemove a couple of tentacles from MiNT missed by commit cd86ed9d430a95bb.
Nicholas Clark [Fri, 21 Sep 2012 10:22:27 +0000 (12:22 +0200)]
Remove a couple of tentacles from MiNT missed by commit cd86ed9d430a95bb.

11 years agoRemove the MPE/iX port.
Nicholas Clark [Thu, 20 Sep 2012 10:04:24 +0000 (12:04 +0200)]
Remove the MPE/iX port.

MPE/iX was a business-oriented minicomputer operating system made by
Hewlett-Packard. Support from HP terminated at the end of 2010.

11 years agoRefactor t/run/switcha.t to use test.pl instead of making TAP by hand.
Colin Kuskie [Sat, 15 Sep 2012 07:53:57 +0000 (00:53 -0700)]
Refactor t/run/switcha.t to use test.pl instead of making TAP by hand.

11 years agoRestore mymalloc build with ithreads
Steve Hay [Thu, 20 Sep 2012 23:25:03 +0000 (00:25 +0100)]
Restore mymalloc build with ithreads

Broken by commit 7cd83f6573.

11 years agoIncrease $File::Glob::VERSION to 1.18
Father Chrysostomos [Thu, 20 Sep 2012 21:48:48 +0000 (14:48 -0700)]
Increase $File::Glob::VERSION to 1.18

11 years ago[perl #114984] Glob.xs: Extend stack when returning
Father Chrysostomos [Thu, 20 Sep 2012 21:25:38 +0000 (14:25 -0700)]
[perl #114984] Glob.xs: Extend stack when returning

If a pattern passed to File::Glob consists of a space-separated list
of patterns, the stack will only be extended by doglob() enough for
the list returned by each subpattern.  So iterate() needs to extend
the stack before copying the list of files from an AV to the stack.

This fixes a regression introduced in 5.16.0.

11 years ago[perl #107002] No warnings test for require a::b+1
Father Chrysostomos [Thu, 20 Sep 2012 16:56:18 +0000 (09:56 -0700)]
[perl #107002] No warnings test for require a::b+1

This used to produce an erroneous ambiguity warning.  The . case
stopped warning in 5.12.0.  The + case stopped warning earlier today
with commit c31f6d3b.

11 years agopp_hot.c: Clean up after the prev commit
Father Chrysostomos [Wed, 4 Jul 2012 19:51:31 +0000 (12:51 -0700)]
pp_hot.c: Clean up after the prev commit

Even before that it was more complicated than necessary, as
SvPV_nomg_const  never returns null.

11 years ago[perl #105922] Allow any string before ->meth
Father Chrysostomos [Thu, 20 Sep 2012 15:56:38 +0000 (08:56 -0700)]
[perl #105922] Allow any string before ->meth

The rules for filtering out what do not look like package names are
not logical and disallow valid things like "::main", while allowing
q"_#@*$!@*^(".

This commit simply lets any non-empty string be used as a package
name.  If it is a typo, you’ll get an error anyway.  This allows
autobox-style calls like "3foo"->CORE::uc, or even "3foo"->uc if you
set up @ISA first.

I made an exception for the empty string because it messes up caches
somehow and causes subsequent method calls all to be called on the
main package.  I haven’t looked into that yet.  I don’t know whether
it’s worth it.

The changes to the tests in cpan/Test-Simple have been submit-
ted upstream.

11 years ago...and we have a 5.17.9 volunteer
Ricardo Signes [Thu, 20 Sep 2012 16:36:48 +0000 (12:36 -0400)]
...and we have a 5.17.9 volunteer

11 years agorelease schedule updates
Ricardo Signes [Thu, 20 Sep 2012 16:26:31 +0000 (12:26 -0400)]
release schedule updates

11 years ago[perl #105924] require 1 << 2
Father Chrysostomos [Thu, 20 Sep 2012 13:24:25 +0000 (06:24 -0700)]
[perl #105924] require 1 << 2

Setting PL_expect after force_next has no effect, as force_next
(called by force_version and force_word) picks up the current value of
PL_expect and arranges for it to be reset thereto after the forced
token is force-fed to the parser.

The KEY_require case should be setting PL_expect to XTERM (as it
already does) when there is no forced token (version or bareword),
because we expect a term after ‘require’, but to XOPERATOR when
there is a forced token, because we expect an operator after that
forced token.

Since the PL_expect assignment has no effect after force_next, we can
set it to XOPERATOR before calling potentially calling force_next, and
then to XTERM afterwards.

Loop exits had the same bug, so this fixes them all.

11 years agoEliminate the vestigial comment "magical thingies" from intrpvar.h
Nicholas Clark [Thu, 20 Sep 2012 08:20:35 +0000 (10:20 +0200)]
Eliminate the vestigial comment "magical thingies" from intrpvar.h

The original comment "magical thingies" was added to perl.c by commit
8ebc5c0145d2e355 in Jan 1997. It is above code which frees 4 interpreter-
global SVs in perl_destruct.

The comment "magical thingies" was in intrpvar.h since the file was created
by commit 49f531dad558d800 on 29 Nov 1997. At that time, it was followed by
a block of 13 relevant interpreter global variables. However, by commit
d4cce5f1785350c2 (30 Nov 1997) all bar two were now in other places, mostly
in thrdvar.h. With the abolition of PL_formfeed, the comment now annotates
just one "magical" thingy, PL_basetime, which isn't even one of the SVs
freed at the analogous location in perl.c. Hence the comment adds no value.

11 years agoUse gv_fetchpvs() instead of gv_fetchpv(), and GV_ADD, not TRUE.
Nicholas Clark [Thu, 20 Sep 2012 08:00:35 +0000 (10:00 +0200)]
Use gv_fetchpvs() instead of gv_fetchpv(), and GV_ADD, not TRUE.

This avoids a needless strlen(), and corrects a classic usage error for the
gv_fetch*() functions.

11 years agoGet rid of PL_formfeed.
Enache Adrian [Sat, 5 Jul 2003 19:08:07 +0000 (22:08 +0300)]
Get rid of PL_formfeed.

$^L is neither a magical variable, nor a normal one (like $;) but
it's just a little bit special :)

This patch removes PL_formfeed - IMHO, an extra gv_fetchpv per page
when using formats isn't going to cause a sensible speed regression.

I suppose that removing the intrpvar.h hunk from the patch is enough
to keep binary compatibility - unless someone used PL_formfeed from
an XS module.

[with regen.pl run as noted by the author, and an additional change to
perl.c to remove the reference to PL_formfeed added soon after this patch
was sent]

11 years agoFor backcompat, B::formfeed can use gv_fetchpvs() if there is no PL_formfeed.
Nicholas Clark [Wed, 19 Sep 2012 20:55:37 +0000 (22:55 +0200)]
For backcompat, B::formfeed can use gv_fetchpvs() if there is no PL_formfeed.

11 years agoop.c: Disentangle apply_attrs_my from apply_attrs
Father Chrysostomos [Thu, 20 Sep 2012 05:03:55 +0000 (22:03 -0700)]
op.c: Disentangle apply_attrs_my from apply_attrs

apply_attrs consisted of a top-level if/else conditional upon a bool-
ean argument.  It was being called with a TRUE argument in only one
place, apply_attrs_my.  Inlining that branch into apply_attrs_my actu-
ally reduces the amount of code slightly.

11 years ago[perl #114764] Stop my vars with attrs from leaking
Father Chrysostomos [Thu, 20 Sep 2012 04:53:51 +0000 (21:53 -0700)]
[perl #114764] Stop my vars with attrs from leaking

S_apply_attrs was creating a SV containing a stash name, that was
later to be put in a const op, which would take care of freeing it.
But it didn’t free it for a my variable, because the branch where that
const op was created didn’t apply.  So move the creation of that SV
inside the branch that uses it, otherwise it leaks.  This leak was the
result of commit 95f0a2f1ffc6.

11 years agoembed.fnc: Remove d flag from cv_clone_into
Father Chrysostomos [Wed, 19 Sep 2012 16:59:46 +0000 (09:59 -0700)]
embed.fnc: Remove d flag from cv_clone_into

I copied it from another entry by mistake.  I don’t think this should
be documented, at least not yet, as I am not confident the interface
is stable yet.  There may be significant changes before 5.18.

11 years agoBump the perl version to 5.17.5
Florian Ragwitz [Wed, 19 Sep 2012 20:23:12 +0000 (16:23 -0400)]
Bump the perl version to 5.17.5

11 years agoAdd a new perldelta
Florian Ragwitz [Wed, 19 Sep 2012 20:09:18 +0000 (16:09 -0400)]
Add a new perldelta

11 years agoAdd the 5.17.4 epigraph
Florian Ragwitz [Wed, 19 Sep 2012 20:07:28 +0000 (16:07 -0400)]
Add the 5.17.4 epigraph

11 years agoFix a few perldelta nits v5.17.4
Florian Ragwitz [Thu, 20 Sep 2012 00:13:17 +0000 (20:13 -0400)]
Fix a few perldelta nits

11 years agoSpecify what to push in the RMG
Florian Ragwitz [Wed, 19 Sep 2012 19:03:27 +0000 (15:03 -0400)]
Specify what to push in the RMG

11 years agoAdd 5.17.4 to perlhist
Florian Ragwitz [Wed, 19 Sep 2012 18:50:55 +0000 (14:50 -0400)]
Add 5.17.4 to perlhist

11 years agoUpdate Module::CoreList for v5.17.4
Florian Ragwitz [Wed, 19 Sep 2012 18:43:43 +0000 (14:43 -0400)]
Update Module::CoreList for v5.17.4

11 years agoMake a note of $Module::CoreList::TieHashDelta::VERSION
Florian Ragwitz [Wed, 19 Sep 2012 18:43:09 +0000 (14:43 -0400)]
Make a note of $Module::CoreList::TieHashDelta::VERSION

11 years agoQuote corelist bugtracker urls
Florian Ragwitz [Wed, 19 Sep 2012 18:42:03 +0000 (14:42 -0400)]
Quote corelist bugtracker urls

XSLoader started to have a bugtracker URL containing single quotes, which is
also what we currently quote bug trackers with.

11 years agoFinalise perldelta
Florian Ragwitz [Wed, 19 Sep 2012 17:52:28 +0000 (13:52 -0400)]
Finalise perldelta

11 years agoRemove an unused variable
Florian Ragwitz [Wed, 19 Sep 2012 17:39:27 +0000 (13:39 -0400)]
Remove an unused variable

11 years agoPerldelta up to 3b9aea0
Florian Ragwitz [Wed, 19 Sep 2012 17:23:48 +0000 (13:23 -0400)]
Perldelta up to 3b9aea0

11 years agoAdd new warning about sleep's limitation on Windows
Steve Hay [Wed, 19 Sep 2012 16:39:17 +0000 (17:39 +0100)]
Add new warning about sleep's limitation on Windows

This also came up recently in [perl #33096]. On Windows, sleep's unsigned
int argument range is effectively reduced by a factor of 1000 because the
emulation uses milliseconds rather than seconds.

11 years agoNote that sleep is emulated on Windows to allow alarm interrupts
Steve Hay [Wed, 19 Sep 2012 16:32:10 +0000 (17:32 +0100)]
Note that sleep is emulated on Windows to allow alarm interrupts

This came up recently in [perl #33096].

11 years agoRemove MAD-only debugging code from Perl_newATTRSUB_flags().
Nicholas Clark [Wed, 19 Sep 2012 15:43:21 +0000 (17:43 +0200)]
Remove MAD-only debugging code from Perl_newATTRSUB_flags().

When MAD was enabled, if the cv under compilation was named "import" it was
assigned to PL_formfeed, and its address issued as an mandatory warning.
The use of PL_formfeed was only ever intended as a way to enter a debugger.
See commits a2edbdc9c7ad6335 and c1bd9b63a6f9fb1f, which removed the other
places that co-opted PL_formfeed for MAD debugging purposes.

11 years agoDocument when the early return in Perl_newPROG() is bypassed completely.
Nicholas Clark [Tue, 4 Sep 2012 19:55:22 +0000 (21:55 +0200)]
Document when the early return in Perl_newPROG() is bypassed completely.

11 years ago[perl #114942] Correct scoping for ‘for my $x(){} $x’
Father Chrysostomos [Wed, 19 Sep 2012 06:19:52 +0000 (23:19 -0700)]
[perl #114942] Correct scoping for ‘for my $x(){} $x’

This was broken by commit 60ac52eb5d5.

What that commit did was to merge two different queues that the
lexer had for pending tokens.  Since bison requires that yylex
return exactly one token for each call, when the lexer sometimes has
to set aside tokens in a queue and return them from the next few
calls to yylex.

Formerly, there were two mechanism: the forced token queue (used by
force_next), and PL_pending_ident.  PL_pending_ident was used for
names that had to be looked up in the pads.

$foo was handled like this:

  First call to yylex:
    1. Put '$foo' in PL_tokenbuf.
    2. Set PL_pending_ident.
    3. Return a '$' token.
  Second call:
    PL_pending_ident is set, so call S_pending_ident, which looks up
    the name from PL_tokenbuf, and return the THING token containing
    the appropriate op.

The forced token queue took precedence over PL_pending_ident.  Chang-
ing the order (necessary for parsing ‘our sub foo($)’) caused some
XS::APItest tests to fail.  So I concluded that the two queues needed
to be merged.

As a result, the $foo handling changed to this:

  First call to yylex:
    1. Put '$foo' in PL_tokenbuf.
    2. Call force_ident_maybe_lex (S_pending_ident renamed and modi-
       fied), which looks up the symbol and adds it to the forced
       token queue.
    3. Return a '$' token.
  Second call:
    Return the token from the forced token queue.

That had the unforeseen consequence of changing this:

    for my $x (...) { ... }
    $x;

such that the $x was still visible after the for loop.  It only hap-
pened when the $ was the next token after the closing }:

$ ./miniperl -e 'for my $x(()){} $x = 3; warn $x'
Warning: something's wrong at -e line 1.
$ ./miniperl -e 'for my $x(()){} ;$x = 3; warn $x'
3 at -e line 1.

This broke Class::Declare.

The name lookup in the pad must not happen before the '$' token is
emitted.  At that point, the parser has not yet created the for loop
(which includes exiting its scope), as it does not yet know whether
there is a continue block.  (See the ‘FOR MY...’ branch of the
barestmt rule in perly.y.)  So we must delay the name lookup till the
second call.

So we rename force_ident_maybe_lex back to S_pending_ident, removing
the force_next stuff.  And we add a new force_ident_maybe_lex function
that adds a special ‘pending ident’ token to the forced token queue.

The part of yylex that handles pending tokens (case LEX_KNOWNEXT) is
modified to account for these special ‘pending ident’ tokens and call
S_pending_ident.

11 years agoUpdate CPANPLUS to CPAN version 0.9131
Chris 'BinGOs' Williams [Wed, 19 Sep 2012 11:40:02 +0000 (12:40 +0100)]
Update CPANPLUS to CPAN version 0.9131

  [DELTA]

  Changes for 0.9131      Tue Sep 18 14:10:16 2012
  ================================================
  * Add Pod::* modules to reported toolchain modules
  * Resolve issue with $cb->search() and SQLite
    source engine

11 years agoSync version, erm, version in Maintainers.pl
Chris 'BinGOs' Williams [Wed, 19 Sep 2012 11:38:02 +0000 (12:38 +0100)]
Sync version, erm, version in Maintainers.pl

11 years ago[perl #99382] 'stat' call documentation is poorly worded
Craig A. Berry [Wed, 19 Sep 2012 06:24:56 +0000 (23:24 -0700)]
[perl #99382] 'stat' call documentation is poorly worded

The use of "block" to describe both the file-or-device-specific sweet
spot for I/O operations and the number of file-system-specific chunks
(not necessarily 512-byte chunks) is unfortunate.  I think we came by
it honestly because Perl just provides a wrapper around:

http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/stat.h.html

which says:

blksize_t st_blksize A file system-specific preferred I/O block size for
                     this object. In some file system types, this may
                     vary from file to file.
blkcnt_t  st_blocks  Number of blocks allocated for this object.

and in the "Rationale" section they say:

"The unit for the st_blocks member of the stat structure is not
defined within IEEE Std 1003.1-2001. In some implementations it is 512
bytes. It may differ on a file system basis. There is no correlation
between values of the st_blocks and st_blksize, and the f_bsize (from
<sys/statvfs.h>) structure members."

The existing piece in perlfunc.pod was written in 1997 for Perl 5.003.
 Screens were smaller then.  Perhaps we could afford to wrap to a
second line now and say something like:

11 years agoembed.fnc: Clarify o comments
Father Chrysostomos [Wed, 19 Sep 2012 03:30:24 +0000 (20:30 -0700)]
embed.fnc: Clarify o comments

It applies also to S_ for static functions.

11 years agoperlgit: bare ‘git push’ is dangerous
Father Chrysostomos [Wed, 19 Sep 2012 03:16:20 +0000 (20:16 -0700)]
perlgit: bare ‘git push’ is dangerous

About three times now I have made changes on a branch, to try things
out, and then later on tried to push to blead with ‘git push’ and
modified other people’s branches at the same time.

11 years agoSquash two win32.c warnings which have crept in recently
Steve Hay [Tue, 18 Sep 2012 19:47:09 +0000 (20:47 +0100)]
Squash two win32.c warnings which have crept in recently

Ensure a non-void function always returns something, and a signed/unsigned
mismatch.

11 years agoAdd missing articles.
Shlomi Fish [Tue, 18 Sep 2012 16:55:36 +0000 (19:55 +0300)]
Add missing articles.

11 years agomake perlhist_calculate.pl emit ready-to-use text
Ricardo Signes [Mon, 17 Sep 2012 15:55:03 +0000 (11:55 -0400)]
make perlhist_calculate.pl emit ready-to-use text

format the data for the line in a line (and right now that line matches
up with the lines in the current table)

format the table in a table so that you can block-select it and paste
into the file

the last two edits were done by hand, which was a drag