platform/upstream/perl.git
12 years agoUpdate perlfaq to CPAN version 5.0150036
Chris 'BinGOs' Williams [Sat, 22 Oct 2011 19:08:35 +0000 (20:08 +0100)]
Update perlfaq to CPAN version 5.0150036

  [DELTA]

  5.0150036 Sat 22 Oct 2011 16:20:34 +0100
    * Website moved from faq.perl.org -> learn.perl.org (ranguard)
    * Delete some questions/cleanup copy (ranguard)
    * Make perlfaq.pod shorter/cleaner (kablamo)
    * Many cleanups and corrections (shlomif)

12 years agoUpdate HTTP-Tiny to CPAN version 0.014
Chris 'BinGOs' Williams [Sat, 22 Oct 2011 19:03:12 +0000 (20:03 +0100)]
Update HTTP-Tiny to CPAN version 0.014

  [DELTA]

  0.014     2011-10-20 13:54:13 America/New_York

  [NEW FEATURES]

  - Adds additional shorthand methods for all common HTTP verbs
    (HEAD, PUT, POST, DELETE) [David Golden]

  - post_form() method for POST-ing x-www-form-urlencoded data
    [David Golden]

  - www_form_urlencode() utility method [David Golden]

12 years agoReimplement $[ as a module
Father Chrysostomos [Fri, 21 Oct 2011 12:58:40 +0000 (05:58 -0700)]
Reimplement $[ as a module

This commit reimplements $[ using PL_check hooks, custom pp func-
tions and ties.

Outside of its compile-time use, $[ is now parsed as a simple varia-
ble, so function calls like foo($[) are permitted, which was not the
case with the former implementation removed by e1dccc0.  I consider
that a bug fix.

The ‘That use of $[ is unsupported’ errors are out of necessity
deferred to run-time and implemented by a tied $[.

Indices between 0 and the array base are now treated consistently, as
are indices between a negative array base and zero.  That, too, is
a bug fix.

12 years agoperlrecharclass: Nit
Karl Williamson [Fri, 21 Oct 2011 01:22:35 +0000 (19:22 -0600)]
perlrecharclass: Nit

12 years agoFix a path in the release guide
Florian Ragwitz [Fri, 21 Oct 2011 01:28:36 +0000 (18:28 -0700)]
Fix a path in the release guide

12 years agoCreate a perldelta for 5.15.5
Florian Ragwitz [Fri, 21 Oct 2011 01:28:23 +0000 (18:28 -0700)]
Create a perldelta for 5.15.5

12 years agoAdd the 5.15.4 epigraph
Florian Ragwitz [Fri, 21 Oct 2011 01:10:56 +0000 (18:10 -0700)]
Add the 5.15.4 epigraph

12 years agoAdd a release announcement template to Porting
David Golden [Thu, 20 Oct 2011 23:13:59 +0000 (19:13 -0400)]
Add a release announcement template to Porting

This makes it just a little bit easier for release managers
and also fixes the perennial north-hemisphere bias in the future
release date.

12 years agoFix the installation of pod2html
Florian Ragwitz [Thu, 20 Oct 2011 20:25:54 +0000 (13:25 -0700)]
Fix the installation of pod2html

12 years agoAdd acknowledgements to the perldelta
Florian Ragwitz [Thu, 20 Oct 2011 17:22:27 +0000 (10:22 -0700)]
Add acknowledgements to the perldelta

12 years agoStop Porting/acknowledgements.pl from producing hatespace
Florian Ragwitz [Thu, 20 Oct 2011 17:22:07 +0000 (10:22 -0700)]
Stop Porting/acknowledgements.pl from producing hatespace

12 years agoAdd 5.15.4 to perlhist
Florian Ragwitz [Thu, 20 Oct 2011 03:37:12 +0000 (20:37 -0700)]
Add 5.15.4 to perlhist

12 years agoRemove the MANIFEST check from the release guide
Florian Ragwitz [Thu, 20 Oct 2011 03:35:07 +0000 (20:35 -0700)]
Remove the MANIFEST check from the release guide

We already have porting tests catching this. I really don't see how this could
end up being screwed or how it'd be more likely at this point during the release
process than at any other time.

12 years agoUpdate Module::CoreList for 5.14.4
Florian Ragwitz [Thu, 20 Oct 2011 03:20:22 +0000 (20:20 -0700)]
Update Module::CoreList for 5.14.4

12 years agoBump the perl version in various places for 5.15.4
Florian Ragwitz [Tue, 18 Oct 2011 18:21:09 +0000 (11:21 -0700)]
Bump the perl version in various places for 5.15.4

12 years agoGet perldelta into mostly finished state
Florian Ragwitz [Thu, 20 Oct 2011 15:58:47 +0000 (08:58 -0700)]
Get perldelta into mostly finished state

12 years agoDavid changelogged this
Florian Ragwitz [Thu, 20 Oct 2011 03:54:02 +0000 (20:54 -0700)]
David changelogged this

Thanks, David!

12 years ago[perl #101738] Make sv_sethek set the UTF8 flag correctly
Father Chrysostomos [Thu, 20 Oct 2011 06:54:57 +0000 (23:54 -0700)]
[perl #101738] Make sv_sethek set the UTF8 flag correctly

It was only ever turning it on, and not turning it off if the sv hap-
pened to have it on from its previous use.

This caused ref() (which uses sv_sethek(TARG,...)) to return a shared
scalar with the UTF8 flag on, even if it was supposed to be off.

For shared scalars, the UTF8 flag on ASCII strings does make a differ-
ence.  The pv *and* the flags are used in hash lookup, for speed.

So a scalar returned by ref() with the UTF8 flag on by mistake would
not work in hash lookups.  exists $classes{ref $foo} would return
false, even if there were an entry for that class.

12 years agoRemove untrue comment from t/op/ref.t
Father Chrysostomos [Thu, 20 Oct 2011 06:42:55 +0000 (23:42 -0700)]
Remove untrue comment from t/op/ref.t

This has been untrue since it was added in commit 6e592b3a.

12 years agobisect-runner.pl now builds test_prep on NetBSD back to 5.002
Nicholas Clark [Thu, 20 Oct 2011 07:26:33 +0000 (09:26 +0200)]
bisect-runner.pl now builds test_prep on NetBSD back to 5.002

The historical NetBSD hints need tweaking for dynamic linking flags, and
older versions of unixish.h needs tweaking to include <signal.h>

12 years agoRemove my todo commits from perldelta template
Steffen Mueller [Thu, 20 Oct 2011 06:46:08 +0000 (08:46 +0200)]
Remove my todo commits from perldelta template

12 years agoperldelta entry for improved AV/etc OUTPUT typemaps
Steffen Mueller [Thu, 20 Oct 2011 06:24:56 +0000 (08:24 +0200)]
perldelta entry for improved AV/etc OUTPUT typemaps

12 years agoDocument the new, fixed AV/etc typemaps
Steffen Mueller [Thu, 20 Oct 2011 06:24:35 +0000 (08:24 +0200)]
Document the new, fixed AV/etc typemaps

12 years agoMake core-cpan-diff work with a minicpan
Steffen Mueller [Thu, 20 Oct 2011 06:09:18 +0000 (08:09 +0200)]
Make core-cpan-diff work with a minicpan

It was trying to download a test file that doesn't exist in minicpans.

12 years agoDennis has (yet) another e-mail address :)
H.Merijn Brand [Wed, 19 Oct 2011 18:27:54 +0000 (20:27 +0200)]
Dennis has (yet) another e-mail address :)

12 years agoBuild failed in Jenkins: perl5 #80
Dennis Kaarsemaker [Wed, 19 Oct 2011 17:37:49 +0000 (19:37 +0200)]
Build failed in Jenkins: perl5 #80

Tiny typo, this will fix it:

[dkaarsemaker@dromedary perl]$ git diff

Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
12 years agoperldelta: document base.pm changes
David Golden [Wed, 19 Oct 2011 16:55:29 +0000 (12:55 -0400)]
perldelta: document base.pm changes

12 years agoregexec.c: Add another place to not re-fold
Karl Williamson [Sun, 16 Oct 2011 20:09:40 +0000 (14:09 -0600)]
regexec.c: Add another place to not re-fold

This adds regrepeat to no keep re-folding to the recent commits

12 years agoregexec.c: Another place to not re-fold
Karl Williamson [Sun, 16 Oct 2011 20:07:51 +0000 (14:07 -0600)]
regexec.c: Another place to not re-fold

A recent commit caused regexec.c to not keep calculating the folds in
one circumstance.  This one adds the case in regmatch

12 years agoutf8.c: Don't use swash for to_uni_lower() latin1 calls
Karl Williamson [Sun, 16 Oct 2011 19:36:36 +0000 (13:36 -0600)]
utf8.c: Don't use swash for to_uni_lower() latin1 calls

The lowercase of latin-1 range code points is known to the perl core, so
for those we can short-ciruit converting to utf8 and reading in a swash

12 years agoregexec.c: Less work in /i matching
Karl Williamson [Sun, 16 Oct 2011 18:47:21 +0000 (12:47 -0600)]
regexec.c: Less work in /i matching

If you watch an execution trace of regexec /i, often you will see it
folding the same thing over and over, as it backtracks or searches
ahead.  regcomp.c has now been changed to always fold UTF-8 encoded
EXACTF and EXCACTFU nodes.  This allows these to not be re-folded each
time.

This commit does it just for find_by_class().  Other commits will expand
this technique for other cases.

12 years agoutf8.c: Add comment
Karl Williamson [Sun, 16 Oct 2011 18:44:48 +0000 (12:44 -0600)]
utf8.c: Add comment

12 years agoutf8.c: White space only
Karl Williamson [Sun, 16 Oct 2011 18:43:54 +0000 (12:43 -0600)]
utf8.c: White space only

Indent newly formed blocks, and reflow comments and code to fit in
narrower space

12 years agoutf8.c: Add 'input pre-folded' flags to foldEQ_utf8_flags
Karl Williamson [Sun, 16 Oct 2011 18:38:58 +0000 (12:38 -0600)]
utf8.c: Add 'input pre-folded' flags to foldEQ_utf8_flags

This adds flags so that if one of the input strings is known to already
have been folded, this routine can skip the (redundant) folding step.

12 years agoregcomp.sym: Add comments
Karl Williamson [Sun, 16 Oct 2011 18:27:44 +0000 (12:27 -0600)]
regcomp.sym: Add comments

12 years agoregcomp.c: White space only
Karl Williamson [Sun, 16 Oct 2011 18:26:47 +0000 (12:26 -0600)]
regcomp.c: White space only

Indent the newly formed block, and reflow comments for narrower
available space.

12 years agoregcomp.c: generate folded for EXACTF and EXACTFU
Karl Williamson [Sun, 16 Oct 2011 18:00:13 +0000 (12:00 -0600)]
regcomp.c: generate folded for EXACTF and EXACTFU

regcomp.c folds the string in these two nodes except in one case.
Change that case to correspond with the predominant behavior.  This
enables future optimizations

12 years agoregexec.c: Stop looking for match sooner
Karl Williamson [Sun, 16 Oct 2011 17:43:08 +0000 (11:43 -0600)]
regexec.c: Stop looking for match sooner

This is a partial reversion of commit
7c1b9f38fcbfdb3a9e1766e02bcb991d1a5452d9
which went unnecessarily far in fixing the problem.

After studying the situation some more, I see more clearly what was
going on.  The point is that if you have only 2 characters left in the
string, but the pattern requires 3 to work, it's guaranteed to fail, so
pointless, and unnecessary work, to try.  So don't being a match trial
at a position when there are fewer than the minimum number of characters
necessary.  That is what the code before that commit did.  However it
neglected the fact that it is possible for a single character to match
multiple ones, so there is not a 1:1 ratio.  This new commit assumes the
worst possible ratio to calculate how far into a string is the furthest
a successful match could start.  This is going to in most cases still
look too far, but it is much better than always going up to the final
character, as the previous patch did.

The maximum ratio is guaranteed by Unicode to be 3:1, but when the
target isn't in UTF-8, the max is 2:1, determined simply by inspection
of the defined folds.  And actually, currently, the single case where it
isn't 1:1 doesn't come up here, because regcomp.c guarantees that that
match doesn't generate one of these EXACTFish nodes.  However, I expect
that to change for 5.16, and so am preparing for that case by making it
2:1.

12 years agoregexec.c: Add comment
Karl Williamson [Sun, 16 Oct 2011 17:40:13 +0000 (11:40 -0600)]
regexec.c: Add comment

12 years agoutf8.c: Add comments
Karl Williamson [Sun, 16 Oct 2011 16:04:51 +0000 (10:04 -0600)]
utf8.c: Add comments

12 years agopp.c: White space only
Karl Williamson [Sun, 16 Oct 2011 15:16:39 +0000 (09:16 -0600)]
pp.c: White space only

This outdents a block to the same level as the surrounding text, and
reflows the comments to take advantage of the extra space and use fewer
lines.

12 years agopp.c: Remove disabled code for context sensitive lc
Karl Williamson [Sun, 16 Oct 2011 15:04:15 +0000 (09:04 -0600)]
pp.c: Remove disabled code for context sensitive lc

This code was always #ifdef'd out.  It would have been used to convert
to a Greek final sigma from a non-final one, depending on context.  The
problem is that we can't know algorithmically if a final sigma is in
order or not.  I excerpt this quote, that I find persuasive, from
correspondence from Father Chrysostomos, who knows Greek:

"I cannot see how any algorithm can know to get it right.

"The letter σ (or Σ in capitals) represents the number 200 in Greek
numerals.  Those are not just ancient Greek numerals, but are used on a
regular basis even in modern Greek.  In many printed books ς is used in
place of ϛ, which represents the number 6.  So if casefolding should
change ͵ΑΣʹ to ͵αςʹ, or if an output layer changes ͵ασʹ similarly, it
will be changing the number (from 1200 to 1006).  You can’t get around
it by checking for the Greek numeral sign (ʹ), as sometimes the tonos
(΄), oxeia (´), or even the ASCII straight quote is used.  And often in
lists or chapter titles a dot is used instead of numeral sign.

"Also, σ is commonly used at the ends  of abbreviations. Changing ‘βλέπε
σ. 16’ (‘see page 16’) to ‘βλέπε ς. 16’ is not acceptable.

"So, no, I don’t think a programming language should be fiddling with σ
versus ς.  (A word processor is another matter.)"

12 years agoregexec.c: omit goto for the common case
Karl Williamson [Sun, 16 Oct 2011 14:30:15 +0000 (08:30 -0600)]
regexec.c: omit goto for the common case

The structure of this code is that initial setup is done and then gotos
or fall-through used to join for the main logic.  This commit just moves
a block, without logic changes, so that the more common case has a
fall-through instead of a goto.

12 years agoMake HvENAME** macros smaller and more efficient
H.Merijn Brand [Mon, 17 Oct 2011 15:15:32 +0000 (17:15 +0200)]
Make HvENAME** macros smaller and more efficient

Brian's comments:
if xhv_name_count == 1, HvENAME_HEK_NN returns null.
So there's no need to use that macro twice. Just check for -1

The real need to make these smaller is the fact that some precompilers
(e.g. HP-UX 10.20) cannot cope with the size these have grown to.  The
precompiler has since got an option (-Hnnn) to increase the macrospace
but that option never made it to these old compilers.

Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
12 years agoin op_dump() / -Dx, replace "DONE" with "NULL"
David Mitchell [Mon, 17 Oct 2011 12:00:32 +0000 (13:00 +0100)]
in op_dump() / -Dx, replace "DONE" with "NULL"

When displaying op_next, it currently shows a null value as "DONE",
which while meaningful on a completely compiled tree, is confusing
on a partially-built tree, where multiple ops may have an op_next of null.

12 years agosimplify op_dump() / -Dx sequencing
David Mitchell [Mon, 17 Oct 2011 11:46:51 +0000 (12:46 +0100)]
simplify op_dump() / -Dx sequencing

Currently, whenever we dump an op tree, we first call sequence(),
which walks the tree, creating address => sequence# mappings in
PL_op_sequence. Then when individual ops or op-next fields are displayed,
the sequence is looked up.

Instead, do away with the initial walk, and just map addresses on request.
This simplifies the code.

As a deliberate side-effect, it no longer assigns a seq# of zero to
null ops. This makes it easer to work out what's going on when you
call op_dump() during a debugging session with partially constructed
op-trees. It also removes the ambiguity in "====> 0" as to whether
op_next is NULL or just points to an op_null.

12 years agodocument boolSV(), which is used in the default typemap
Tony Cook [Tue, 11 Oct 2011 05:30:44 +0000 (16:30 +1100)]
document boolSV(), which is used in the default typemap

12 years agoperldelta: Mention another thing fixed by 2fc49ef14c
Father Chrysostomos [Sun, 16 Oct 2011 23:10:28 +0000 (16:10 -0700)]
perldelta: Mention another thing fixed by 2fc49ef14c

12 years agocv.h: comment typo
Father Chrysostomos [Sun, 16 Oct 2011 23:02:22 +0000 (16:02 -0700)]
cv.h: comment typo

Commit 7c60e434 removed the ‘match’.

12 years agoRestore null checks to stashpv_hvname_match [perl #101430]
Father Chrysostomos [Sun, 16 Oct 2011 20:18:46 +0000 (13:18 -0700)]
Restore null checks to stashpv_hvname_match [perl #101430]

Commit aa33328e8 inadvertently removed the null checks from
stashpv_hvname_match when adding UTF8 support, resulting in crashes it
List::Gen’s test suite.

12 years agoDocument calling convention for XS cmp routines
Father Chrysostomos [Sun, 16 Oct 2011 18:59:41 +0000 (11:59 -0700)]
Document calling convention for XS cmp routines

12 years agoAdd email addr to AUTHORS to keep tests quiet
Father Chrysostomos [Sun, 16 Oct 2011 05:53:28 +0000 (22:53 -0700)]
Add email addr to AUTHORS to keep tests quiet

12 years agoIncrease $File::DosGlob::VERSION from 1.04 to 1.05
Father Chrysostomos [Sun, 16 Oct 2011 05:53:10 +0000 (22:53 -0700)]
Increase $File::DosGlob::VERSION from 1.04 to 1.05

12 years agofix a typo in a comment
Thorsten Glaser [Sun, 16 Oct 2011 00:42:39 +0000 (00:42 +0000)]
fix a typo in a comment

someone already fixed the expanshions but kept the preformed on the same line

Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
12 years agoCorrect comment in pad.c
Father Chrysostomos [Sun, 16 Oct 2011 01:39:59 +0000 (18:39 -0700)]
Correct comment in pad.c

It said exactly the opposite of what was meant.

12 years agoperldelta up to c19fd8b40
Father Chrysostomos [Sat, 15 Oct 2011 23:55:07 +0000 (16:55 -0700)]
perldelta up to c19fd8b40

12 years agoTest uninit warnings for undef XS cmp retvals
Father Chrysostomos [Sat, 15 Oct 2011 21:08:31 +0000 (14:08 -0700)]
Test uninit warnings for undef XS cmp retvals

12 years agoMake XS sort routines work again
Father Chrysostomos [Sat, 15 Oct 2011 21:05:33 +0000 (14:05 -0700)]
Make XS sort routines work again

These stopped working when the CvROOT and CvXSUB fields were merged
in 5.10.0:

$ perl5.8.9 -le 'print sort utf8::is_utf8 2,1'
Usage: utf8::is_utf8(sv) at -e line 1.
$ perl5.10.0 -le 'print sort utf8::is_utf8 2,1'
12

(In the latter case, the utf8::is_utf8 routine is not being called.)

pp_sort has this:

    if (!(cv && CvROOT(cv))) {
if (cv && CvISXSUB(cv)) {

But CvROOT is the same as CvXSUB, so that block is never entered for
XSUBs, so this piece of code later on:

    if (is_xsub)
PL_sortcop = (OP*)cv;
    else
PL_sortcop = CvSTART(cv);

sets PL_sortcop to CvSTART for XSUBs, but CvSTART is NULL.  Later on,
this if condition fails:

if (PL_sortcop) {

so the XSUB is treated as being absent.

12 years agoAPItest: put mro stuff in a new BOOT block
Father Chrysostomos [Sat, 15 Oct 2011 13:54:13 +0000 (06:54 -0700)]
APItest: put mro stuff in a new BOOT block

I added it to an existing block without realising that it was for
a separate package and that the standard convention throughout
APItest.xs is to use a separate BOOT block for every tested feature.

12 years agoIn bisect-runner.pl's synopsis, the test program must be outside the cwd.
Nicholas Clark [Fri, 14 Oct 2011 12:03:44 +0000 (13:03 +0100)]
In bisect-runner.pl's synopsis, the test program must be outside the cwd.

Karl notes that the previous version, using C<test_prog.pl>, wrongly
suggests that a test program can be in the git checkout used for
bisecting. This won't work for an untracked file, because bisect.pl's first
sanity check will spot it and refuse to run. For a tracked file (such as an
existing test script in t), things may be far more confusing, as
bisect-runner.pl will end up running the current version for the revision
tested, instead of the version for the revision checked out at start time.

12 years agobisect-runner.pl should patch $trnl into makedepend.SH if needed.
Nicholas Clark [Fri, 14 Oct 2011 11:21:28 +0000 (12:21 +0100)]
bisect-runner.pl should patch $trnl into makedepend.SH if needed.

4b081584932d92f8 provided Configure with a value for trnl, to enable blead's
makedepend.SH to work on Perls prior to 5.003. However, af7c500f1fae390f
effectively broke this, by migrating the expansion of makedepend.SH from
Configure time to later, because "unknown" values passed to Configure on the
command line are never written to config.sh. Hence bisect-runner.pl should
patch makedepend.SH (blead's version) with the correct value for trnl, as
this is less invasive than adding to config.sh

"effectively broke", because bisect-runner.pl runs all commands with STDIN
redirected from /dev/null, so makedepend's attempts to read from STDIN in
its confusion immediately failed without anything hanging.

12 years agoStop uninit sort warnings from crashing
Father Chrysostomos [Fri, 14 Oct 2011 03:25:39 +0000 (20:25 -0700)]
Stop uninit sort warnings from crashing

Commit d4c6760a made the warning in cases like this mention the
sort operator:

$ ./miniperl -we '()=sort { undef } 1,2'
Use of uninitialized value [in sort] at -e line 1.

It did so by setting PL_op during the SvIV(retval of sort block).  But
sv.c:S_find_uninit_var, called by report_uninit, tries to access the
targets of some ops, which are in PL_curpad on threaded builds.  In
the case of a sort sub (rather than an inlined block), PL_curpad con-
tained whatever was left over from the sort block (I presume, but
have not confirmed; in any case what is in PL_curpad is bad), causing
find_uninit_var to crash.

This commit sets PL_curpad to null and puts a check for it in
report_uninit.

It did not crash in debugging threaded builds, but that was probably
luck (even though I don’t believe in it).

12 years agoregexec.c: Fix "\x{FB01}\x{FB00}" =~ /ff/i
Karl Williamson [Fri, 14 Oct 2011 01:56:45 +0000 (19:56 -0600)]
regexec.c: Fix "\x{FB01}\x{FB00}" =~ /ff/i

Only the first character of the string was being checked when scanning
for the beginning position of the pattern match.

This was so wrong, it looks like it has to be a regression.  I
experimented a little and did not find any.  I believe (but am not
certain) that a multi-char fold has to be involved.  The the handling of
these was so broken before 5.14 that there very well may not be a
regression.

12 years agoregexec.c: Add comments
Karl Williamson [Fri, 14 Oct 2011 01:53:53 +0000 (19:53 -0600)]
regexec.c: Add comments

12 years agot/re/re_tests: Add tests for multi-char fold bug
Karl Williamson [Fri, 14 Oct 2011 01:50:10 +0000 (19:50 -0600)]
t/re/re_tests: Add tests for multi-char fold bug

This problem has to do with two multi-char folded constants in a row in
the string being matched.

Spotted by Tom Christiansen

12 years agoUpdate Archive-Tar to CPAN version 1.80
Chris 'BinGOs' Williams [Thu, 13 Oct 2011 19:32:28 +0000 (20:32 +0100)]
Update Archive-Tar to CPAN version 1.80

  [DELTA]

  * important changes in version 1.80 13/10/2011
  - patch from Rocky Bernstein to add file chown() method [rt#71221]

12 years agoMention all variables in $undef..$undef warnings
Father Chrysostomos [Thu, 13 Oct 2011 16:52:00 +0000 (09:52 -0700)]
Mention all variables in $undef..$undef warnings

Commit c774086b8 made this:

$ ./miniperl -lwe '()=my $undef1..my $undef2'
Use of uninitialized value in range (or flop) at -e line 1.
Use of uninitialized value in range (or flop) at -e line 1.

become this:

$ ./miniperl -lwe '()=my $undef1..my $undef2'
Use of uninitialized value $undef2 in range (or flop) at -e line 1.
Use of uninitialized value in range (or flop) at -e line 1.

which was slightly better.  This commit finishes the job:

$ ./miniperl -lwe '()=my $undef1..my $undef2'
Use of uninitialized value $undef1 in range (or flop) at -e line 1.
Use of uninitialized value $undef2 in range (or flop) at -e line 1.

12 years agoCall get-magic once for .. in list context
Father Chrysostomos [Thu, 13 Oct 2011 07:11:45 +0000 (00:11 -0700)]
Call get-magic once for .. in list context

In addition to using _nomg calls in pp_flop, I had to modify
looks_like_number, which was clearly buggy: it was ignoring get-magic
completely, *except* in the case of SvPOKp.  But checking SvPOKp
before calling magic does not make sense, as it may change during the
magic call.

12 years ago[perl #94390] Optimised numeric sort should warn for nan
Father Chrysostomos [Thu, 13 Oct 2011 05:53:31 +0000 (22:53 -0700)]
[perl #94390] Optimised numeric sort should warn for nan

In this case:

    sort { $a <=> $b } ...

the sort block is optimised away and implemented in C.

That C implementation did not take into account that $a or $b might be
nan, and therefore, without optimisation, would return undef, result-
ing in a warning.

The optimisation is supposed to be just that, and not change
behaviour.

12 years agoMention sort in warnings about sort sub retvals
Father Chrysostomos [Thu, 13 Oct 2011 03:28:21 +0000 (20:28 -0700)]
Mention sort in warnings about sort sub retvals

With this commit,

$ ./miniperl -we '()=sort { undef } 1,2'
Use of uninitialized value at -e line 1.

becomes

$ ./miniperl -we '()=sort { undef } 1,2'
Use of uninitialized value in sort at -e line 1.

12 years agoperlfunc: sort no longer dies on undef retval
Father Chrysostomos [Thu, 13 Oct 2011 01:10:17 +0000 (18:10 -0700)]
perlfunc: sort no longer dies on undef retval

This changed in 5.12.0.  See bug #69384 and commit 93e19c0f.

12 years agoAvoid an redundant copy in pp_flop
Father Chrysostomos [Wed, 12 Oct 2011 17:01:41 +0000 (10:01 -0700)]
Avoid an redundant copy in pp_flop

This copy, which occurs with "a".."z" in list context, has been there
since alphabetic ranges were added in commit b1248f16c (perl 3.0 patch
#17 patch #16, continued).

As a side effect, this:

$ ./miniperl -lwe '()=my $undef1..my $undef2'
Use of uninitialized value in range (or flop) at -e line 1.
Use of uninitialized value in range (or flop) at -e line 1.

becomes this:

$ ./miniperl -lwe '()=my $undef1..my $undef2'
Use of uninitialized value $undef2 in range (or flop) at -e line 1.
Use of uninitialized value in range (or flop) at -e line 1.

which is slightly better. :-)

12 years agoperlguts: UNIVERSAL::AUTOLOAD caveat
Father Chrysostomos [Wed, 12 Oct 2011 12:38:52 +0000 (05:38 -0700)]
perlguts: UNIVERSAL::AUTOLOAD caveat

12 years agoAPItest: Move PERL_UNUSED_ARG after decl
Father Chrysostomos [Wed, 12 Oct 2011 12:44:05 +0000 (05:44 -0700)]
APItest: Move PERL_UNUSED_ARG after decl

12 years agobisect-runner.pl now builds test_prep on OS X back to 5.001n
Nicholas Clark [Wed, 12 Oct 2011 08:43:55 +0000 (10:43 +0200)]
bisect-runner.pl now builds test_prep on OS X back to 5.001n

bisect.pl is now suitable for general use on (at least) Linux, FreeBSD and
OS X. [Tested on Snow Leopard on a case-sensitive file system. The latter is
a requirement for some older intermediate revisions of perl]

bisect-runner.pl now sets $ENV{$Config{ldlibpthname}} before running the
supplied test case, which is necessary when perl is built with
useshrplib='true'

The historical Darwin hints require some tweaking for cflags and ldflags.
Adding the Darwin hints and dl_dyld.xs with minimal patching is sufficient
to build perl and all extensions back to 5.001n, allowing Darwin systems to
be used for general bisecting, not just Darwin specific issues.

12 years agoImprove documentation of XS autoloading
Father Chrysostomos [Wed, 12 Oct 2011 06:02:41 +0000 (23:02 -0700)]
Improve documentation of XS autoloading

12 years ago[perl #6828] Set $AUTOLOAD once more for XS autoloading
Father Chrysostomos [Wed, 12 Oct 2011 04:35:00 +0000 (21:35 -0700)]
[perl #6828] Set $AUTOLOAD once more for XS autoloading

In 5.6.0, XS autoloading worked.  $AUTOLOAD would be set, as with
a Perl sub.

Commit ed850460 (5.6.1) allowed ‘sub AUTOLOAD;’ to prevent autoload
inheritance.  But the code to check for that mistakenly equated an
XSUB with a forward declaration.  So XS autoloading simply did not
work any more.

Then someone found it didn’t work and introduced it as a ‘new’ feature
in 5.8.0, with commit adb5a9ae.  For efficiency’s sake, instead of
joining the package name and sub name together, only to have the XSUB
do the same, it set the CvSTASH and SvPVX fields of the SV.

SvPVX was already being used for the sub’s prototype, so 8fa6a409
(just recently) made the autoloaded sub name and the prototype play
along nicely together, with a few fix-up commits (05b525f43d5f9785
and 74ee33f2).

It was only after that that I find out that $AUTOLOAD used to be set
for XSUBs.  See the discussion at these two links

    http://www.nntp.perl.org/group/perl.perl5.porters/;msgid=4E9468E8.8050206@cpan.org
    https://rt.perl.org/rt3/Ticket/Display.html?id=72708

This commit restores the original behaviour of setting $AUTOLOAD for
XSUBs, while retaining the CvSTASH+SvPVX method as well, as it has
been documented for a while.

Steffen Müller’s AUTOLOAD tests that I committed recently (120b7a08)
needed to be adjusted a bit.  The test count was off, which was my
fault (I *thought* I had checked that.)  The test XSUB was using
get_sv("AUTOLOAD"), which ended up fetching the caller’s $AUTOLOAD.
It was also using SvPV_set on an undefined scalar, which does not turn
the SvPOK flag on.

12 years agoTODO test for $AUTOLOAD with XS AUTOLOAD
Steffen Mueller [Wed, 12 Oct 2011 01:20:06 +0000 (18:20 -0700)]
TODO test for $AUTOLOAD with XS AUTOLOAD

If an AUTOLOAD sub is an XSUB, $AUTOLOAD won't be set. This is intended
as an optimization, but $AUTOLOAD *was* set back in 5.6.0, so this is
a regression.

Committer’s note: I modified the commit message and the comments, as
the original author did not know about the autoload mechanism setting
CvSTASH.  For that matter, neither did I till yesterday.

12 years agoSSize_t, not IV, is a signed STRLEN
Chip Salzenberg [Wed, 12 Oct 2011 00:30:29 +0000 (17:30 -0700)]
SSize_t, not IV, is a signed STRLEN

12 years ago[perl #30661] autoload sort subs
Father Chrysostomos [Tue, 11 Oct 2011 21:07:44 +0000 (14:07 -0700)]
[perl #30661] autoload sort subs

12 years agomro.c: Oops, missing a =cut
Father Chrysostomos [Tue, 11 Oct 2011 19:48:33 +0000 (12:48 -0700)]
mro.c: Oops, missing a =cut

12 years agoEliminate (X|F) convention from perldiag.
Father Chrysostomos [Tue, 11 Oct 2011 15:41:30 +0000 (08:41 -0700)]
Eliminate (X|F) convention from perldiag.

Commit 748a930 (perl 5.001) introduced the (W)(S) convention in
perldiag, for messages under multiple categories.  (There were none
before that.)

Commit 55497cf (inseparable changes from patch from perl5.003_07 to
perl5.003_08) introduced the (X|F) convention.  There have been two
ever since.

This commit makes perldiag consistently use the original (5.001)
convention.

12 years agoCorrected: 'possible a' => 'possibly a'
Alan Haggai Alavi [Tue, 11 Oct 2011 13:43:19 +0000 (19:13 +0530)]
Corrected: 'possible a' => 'possibly a'

Signed-off-by: David Golden <dagolden@cpan.org>
12 years agoCorrected: 'filehanlde' => 'filehandle'
Alan Haggai Alavi [Tue, 11 Oct 2011 13:35:50 +0000 (19:05 +0530)]
Corrected: 'filehanlde' => 'filehandle'

Signed-off-by: David Golden <dagolden@cpan.org>
12 years agoCorrected: 'can made' => 'can be made'
Alan Haggai Alavi [Tue, 11 Oct 2011 13:35:25 +0000 (19:05 +0530)]
Corrected: 'can made' => 'can be made'

Signed-off-by: David Golden <dagolden@cpan.org>
12 years agoCorrected: 'Zeus for Window' => 'Zeus for Windows'
Alan Haggai Alavi [Sat, 8 Oct 2011 09:02:54 +0000 (14:32 +0530)]
Corrected: 'Zeus for Window' => 'Zeus for Windows'

Signed-off-by: David Golden <dagolden@cpan.org>
12 years agoMake sv_set[ps]v(cv...) set prototype
Father Chrysostomos [Tue, 11 Oct 2011 12:54:57 +0000 (05:54 -0700)]
Make sv_set[ps]v(cv...) set prototype

The SvPVX slot of a CV is used both for the prototype and for the sub
name passed to an XS AUTOLOAD sub.

It used to be that such AUTOLOADing would clobber the prototype.

Commit 8fa6a4095 made the two uses of SvPVX try to play along nicely
with each other, so the prototype comes after the sub name if both
need to be present.  It added the CvPROTO macro to account for that.

Some CPAN modules expect to be able to set the prototype with
sv_set[ps]v.  So this commit makes that work as expected, by turn-
ing off the flag that says the prototype comes after the auto-
loaded sub name.

Anyone using Scalar::Util::set_prototype to work around the proto-
type-clobbering bug can now continue to do so, without triggering
a new bug.

12 years agoadd missing STATIC to S_finalize_op
David Mitchell [Tue, 11 Oct 2011 10:01:35 +0000 (11:01 +0100)]
add missing STATIC to S_finalize_op

This function was declared static in embed.fnc, but the actual function
definition was missing the 'STATIC'.

12 years agoXS::APItest: s/justinc/justisa/
Father Chrysostomos [Tue, 11 Oct 2011 06:51:53 +0000 (23:51 -0700)]
XS::APItest: s/justinc/justisa/

I meant to call this mro ‘just @ISA’, because it just uses @ISA and
no super-superclasses.  But I misnamed it.  It has nothing to do
with @INC.

12 years agoAlso add repaired variants for CV and SVREF typemaps
Steffen Mueller [Sun, 9 Oct 2011 20:00:21 +0000 (22:00 +0200)]
Also add repaired variants for CV and SVREF typemaps

12 years agoA repaired, properly refcounting AV&HV typemap
Steffen Mueller [Sun, 9 Oct 2011 18:34:29 +0000 (20:34 +0200)]
A repaired, properly refcounting AV&HV typemap

The T_AVREF_REFCOUNT_FIXED and T_HVREF_REFCOUNT_FIXED can be used
in place of T_AVREF/T_HVREF. They do away with having to remember
to decrement refcounts manually.

12 years ago[perl #94306] Do not skip first elem of linear isa
Father Chrysostomos [Tue, 11 Oct 2011 06:31:55 +0000 (23:31 -0700)]
[perl #94306] Do not skip first elem of linear isa

Perl has assumed up till now that the first element of an isa linear-
isation is the name of the class itself.  That is true for dfs and c3,
but not requiring that makes it easier for plugin authors.

Since various parts of the mro code make that assumption, this commit
copies the AV returned by mro_alg.resolve to a new one beginning with
the class’s own name, if the original AV did not include it.

12 years agoDocument calling convention for Perl_mro_register
Father Chrysostomos [Tue, 11 Oct 2011 06:28:19 +0000 (23:28 -0700)]
Document calling convention for Perl_mro_register

I had to look in embed.fnc to find this out when I wanted to use it.

12 years agoStop attribute errors from leaking op trees
Father Chrysostomos [Tue, 11 Oct 2011 05:30:18 +0000 (22:30 -0700)]
Stop attribute errors from leaking op trees

This commit moves attribute handling in newATTRSUB so that it happens
after the op tree is attached to the sub.  So when the sub is freed,
the op tree goes with it, instead af leaking when an attribute han-
dler dies.

Witness what happens without that:

$ PERL_DESTRUCT_LEVEL=2 ./perl -Ilib -le 'BEGIN {$^H{a}="b"}; sub foo:bar{1}'
Invalid CODE attribute: bar at -e line 1
BEGIN failed--compilation aborted at -e line 1.
Unbalanced string table refcount: (1) for "a" at (null) line 1 during global destruction.

It was the ‘Unbalanced string table’ warnings that alerted me to the
problem.  The fairly new t/uni/attrs.t happens to trigger this bug.

Not that this told me anything, but I did a binary search which lead
me to this commit:

commit b3ca2e834c3607fd8aa8736a51aa3a2b8bba1044
Author: Nicholas Clark <nick@ccl4.org>
Date:   Fri Mar 31 13:45:57 2006 +0000

    Serialise changes to %^H onto the current COP. Return the compile time
    state of %^H as an eleventh value from caller. This allows users to
    write pragmas.

That commit started indirectly storing HEKs in cops (in the hints
hash), which means we have an easy way to tell when ops are leaking.

12 years agounder DEBUGGING, minimize the sentinels written in sv_chop, to avoid substr slowdown
Chip Salzenberg [Tue, 11 Oct 2011 02:39:14 +0000 (19:39 -0700)]
under DEBUGGING, minimize the sentinels written in sv_chop, to avoid substr slowdown

12 years agotweak sv_chop pod
Chip Salzenberg [Tue, 11 Oct 2011 02:03:18 +0000 (19:03 -0700)]
tweak sv_chop pod

12 years agodo not return useless value from void-context substr
Chip Salzenberg [Tue, 11 Oct 2011 01:59:42 +0000 (18:59 -0700)]
do not return useless value from void-context substr

12 years agoI32 may not be big enough for string insert length
Chip Salzenberg [Tue, 11 Oct 2011 01:57:56 +0000 (18:57 -0700)]
I32 may not be big enough for string insert length

12 years agoAvoid creating extra SVs in gv_fullname4
Father Chrysostomos [Mon, 10 Oct 2011 23:23:10 +0000 (16:23 -0700)]
Avoid creating extra SVs in gv_fullname4

12 years agoFix cv-to-gv assignment to use CvPROTO
Father Chrysostomos [Mon, 10 Oct 2011 21:36:53 +0000 (14:36 -0700)]
Fix cv-to-gv assignment to use CvPROTO

The SvPVX field of a XS AUTOLOAD sub can contain both the prototype
and the name of an AUTOLOADed sub.  The CvPROTO macro knows where in
the buffer to find the prototype.  All code that reads the prototype
should use it.  When I introduced it with commit 8fa6a4095, one code
path was missed: *regular_prototyped_sub = \&prototyped_XS_AUTOLOAD
was using the sub name of the rhs, instead of the prototype, in the
prototype check.