platform/upstream/perl.git
13 years agoAdd Craig DeForest to AUTHORS
Father Chrysostomos [Mon, 30 May 2011 16:52:36 +0000 (09:52 -0700)]
Add Craig DeForest to AUTHORS

13 years ago[perl #31946] Warn when assigning to a TEMP
Father Chrysostomos [Mon, 30 May 2011 16:49:36 +0000 (09:49 -0700)]
[perl #31946] Warn when assigning to a TEMP

This is the first step in downgrading a fatal error (Can't return a
temporary from lvalue subroutine) to a warning. Currently only XS
lvalue routines that return TEMPs and pure-Perl lvalue routines that
use explicit return (which don’t quite work properly yet anyway,
despite commit fa1e92c) are affected by this.

This is implemented in pp_sassign and pp_aassign, rather than
pp_leavesublv, so it will affect explicit returns and so it will
be skipped for overloaded ‘.=’, etc.

Thanks to Craig DeForest for suggesting how to do this.

13 years ago[perl #91880] $_ refcounting problems in @INC filters
Father Chrysostomos [Mon, 30 May 2011 15:55:40 +0000 (08:55 -0700)]
[perl #91880] $_ refcounting problems in @INC filters

In @INC filters (subs returned by subs in @INC), $_ is localised to a
variable to which the next line of source code is to be assigned. The
function in pp_ctl.c that calls it (S_run_user_filter) has a pointer
to that variable.

Up till now, it was not setting the refcount or localising
$_ properly.

‘undef *_’ inside the sub would destroy the only refcount it
had, leaving a freed sv for toke.c to parse (which would crash,
of course).

In some cases, S_run_user_filter has to created a new variable. In
those cases, it was setting $_ to a mortal variable with the TEMP
flag, but with a refcount of 1, which would result in ‘Attempt to free
unreferenced scalar’ warnings if the $_ were freed by the subroutine.

This commit changes S_run_user_filter to use SAVEGENERICSV, rather
than SAVE_DEFSV, to localise $_, since the former lowers the refcount
on scope exit, while the latter does not. So now I have also made it
increase the refcount after assigning to the now-properly-localised $_
(DEFSV). I also turned off the TEMP flag, to avoid weird side effects
(which were what led me to this bug to begin with).

13 years ago2nd try: [perl #91834] utf8::decode does not respect copy-on-write
Father Chrysostomos [Mon, 30 May 2011 03:39:33 +0000 (20:39 -0700)]
2nd try: [perl #91834] utf8::decode does not respect copy-on-write

I reverted the first version of this patch because I put the if()
statement before a declaration. I did a revert, rather than a correc-
tion, to make back-porting easier.

13 years agoRevert "[perl #91834] utf8::decode does not respect copy-on-write"
Father Chrysostomos [Mon, 30 May 2011 03:36:05 +0000 (20:36 -0700)]
Revert "[perl #91834] utf8::decode does not respect copy-on-write"

This reverts commit 40f11004fb3b5fa1cd207a20090df837d721b736.

13 years agomktables: Avoid possible user-defined property
Karl Williamson [Mon, 30 May 2011 03:14:51 +0000 (21:14 -0600)]
mktables: Avoid possible user-defined property

Properties with no elements are defined in terms of the complement
of the property which matches all of Unicode: \p{Any}.  But it
currently is defined in terms of IsAny, which is user-overridable;
Just drop the 'Is'

13 years ago[perl #91834] utf8::decode does not respect copy-on-write
Father Chrysostomos [Sun, 29 May 2011 21:21:06 +0000 (14:21 -0700)]
[perl #91834] utf8::decode does not respect copy-on-write

utf8::decode was not respecting copy-on-write, but simply modify-
ing the PV (the scalar’s string buffer) in place, causing problems
with hashes:

my $name = "\x{c3}\x{b3}";
my ($k1) = keys %{ { $name=>undef } };
my $k2 = $name;
utf8::decode($k1);
utf8::decode($k2);
print "k1 eq k2 = '", $k1 eq $k2, "'\n";
my $h = { $k1 => 1, $k2 => 2 };
print "{k1} '", $h->{$k1}, "'\n";
print "{k2} '", $h->{$k2}, "'\n";

This example (from the RT ticket) shows that there were two hash ele-
ments with the same key.

As of this commit, the hash only has one element.

13 years agoCorrect English
Father Chrysostomos [Sun, 29 May 2011 20:07:20 +0000 (13:07 -0700)]
Correct English

13 years agoformats: allow > 256 decimal places
David Mitchell [Sun, 29 May 2011 19:17:14 +0000 (20:17 +0100)]
formats: allow > 256 decimal places

Currently bits 256 and 512 of the floating point len arg are used to
flag extra things. Since we have 32-bit args now, change these bits
to higher ones so there's no such arbitrary restriction.

Also, define two symbolic constants rather than hard-coding in the bit
values.

13 years agoAllow formats with lines >64K
David Mitchell [Sun, 29 May 2011 18:54:58 +0000 (19:54 +0100)]
Allow formats with lines >64K

Back in 2003, the format bytecode was changed to allow 32-bit offsets,
but all the stored offsets were still being cast to U16. So for example
only the first char of a 65537 char literal would be output.

This commit removes all the U16 casts.

13 years agopp_formline: handle growing better
David Mitchell [Sun, 29 May 2011 18:27:56 +0000 (19:27 +0100)]
pp_formline: handle growing better

We initially grow PL_formtarget by the largest amount a formline can
append (since formats are fixed width). The only thing that can exceed
that is @*; but also, if PL_formtarget gets upgraded to utf8, then some of
the extra buffer we allocated can get eaten up by the upgrade.

Codify this so we only grow when necessary, but always enough.

Prior to this commit, we were growing FF_ITEM/FF_LITERAL too much, and
FF_LINEGLOB too little (the latter being my mistake from a few commits
ago).

Also rename 'fudge' to 'linemax', to give a better idea what it's for.

13 years agopp_formline: keep linemark consistent
David Mitchell [Sun, 29 May 2011 16:13:07 +0000 (17:13 +0100)]
pp_formline: keep linemark consistent

linemark is a pointer to the current start of the line. This allows
things like ~ to delete back to the start of the line.

Convert it into an offset, so that it isn't invalidated if PL_formtarget
is reallocated. Also recalculate it if PL_formtarget is upgraded to utf8.

13 years agopp_formline: make FF_ITEM use FF_LINEGLOB code
David Mitchell [Sun, 29 May 2011 15:07:36 +0000 (16:07 +0100)]
pp_formline: make FF_ITEM use FF_LINEGLOB code

Now that we've got the two chunks of append code similar enough to each
other, make FF_ITEM just goto into the append part of the FF_LINEGLOB
code.

13 years agopp_formline: make FF_LITERAL use FF_LINEGLOB code
David Mitchell [Sun, 29 May 2011 13:29:45 +0000 (14:29 +0100)]
pp_formline: make FF_LITERAL use FF_LINEGLOB code

Now that we've got the two chunks of append code similar enough to each
other, make FF_LITERAL just goto into the append part of the FF_LINEGLOB
code.

13 years agopp_formline: don't overgrow PL_formtarget
David Mitchell [Sun, 29 May 2011 13:01:11 +0000 (14:01 +0100)]
pp_formline: don't overgrow PL_formtarget

In various places, PL_formtarget is grown by fudge bytes.
But fudge is already equal to the whole width of the format line,
and PL_formtarget is pre-grown by fudge at the start, so normally
there's no need to extend it further. So don't.
Instead, only grow it by the amount needed (which will ormally be nothing)
as a safety measure.

Also add an assert at the end to check that we haven't overrun the buffer.

13 years agopp_formline: no need to *t = '\0' until end
David Mitchell [Sun, 29 May 2011 12:34:31 +0000 (13:34 +0100)]
pp_formline: no need to *t = '\0' until end

We don't care whether PL_formtarget has a trailling \0 until we return;
so remove the bits where we add one in between.

13 years agopp_formline: FF_LINEGLOB: always SvCUR_set
David Mitchell [Sun, 29 May 2011 12:03:54 +0000 (13:03 +0100)]
pp_formline: FF_LINEGLOB: always SvCUR_set

The code currently does SvCUR_set(PL_formtarget,...) in three out of four
of the condition branches. Since it's harmless to do it also for the
fourth, remove the three individual SvCUR_set()s and replace with a single
unconditional one.

13 years agopp_formline: don't set itemsize in FF_LINEGLOB
David Mitchell [Sun, 29 May 2011 11:41:42 +0000 (12:41 +0100)]
pp_formline: don't set itemsize in FF_LINEGLOB

This var is used to enable padding or truncating of output items.
FF_LINESNGL/FF_LINEGLOB do their own version of this, so there's
no need to set it there.

Or to put it another way, we don't expect a FF_LINESNGL or FF_LINEGLOB op
to be followed immediately by FF_SPACE, FF_HALFSPACE, FF_ITEM nor FF_MORE.

Not calculating it makes the code simpler and eases the path to merging
the appending code.

13 years agopp_formline: make FF_LITERAL use item_is_utf8 flag
David Mitchell [Sun, 29 May 2011 11:16:23 +0000 (12:16 +0100)]
pp_formline: make FF_LITERAL use item_is_utf8 flag

This is in preparation for merging with the FF_LINEGLOB code.
Should be no change in functionality.

13 years agopp_formline: don't do get mg on PL_formtarget
David Mitchell [Sat, 28 May 2011 14:59:05 +0000 (15:59 +0100)]
pp_formline: don't do get mg on PL_formtarget

Two of the three branches that upgrade PL_formtarget to utf8 (FF_LITERAL,
FF_ITEM) do get magic while doing so, while the third (FF_LINEGLOB)
doesn't. I think the first two were just co-incidental
(they started out as simple sv_utf8_upgrade() calls added by
1bd51a4ce2ce8, and probably no consideration was given as to whether to
use the _nomg variant instead).

Make the first two no longer call magic, to be consistent with
FF_LINEGLOB.

13 years agopp_formline: split FF_LINEGLOB into two blocks
David Mitchell [Sat, 28 May 2011 14:17:37 +0000 (15:17 +0100)]
pp_formline: split FF_LINEGLOB into two blocks

The second block is shortly going to be used by others too

13 years agopp_formline: FF_LINEGLOB: hoist 2 vars to fn scope
David Mitchell [Sat, 28 May 2011 14:13:27 +0000 (15:13 +0100)]
pp_formline: FF_LINEGLOB: hoist 2 vars to fn scope

more groundwork for making the code in FF_LINEGLOB re-usable

13 years agopp_formline: reduce indent in FF_LINEGLOB
David Mitchell [Sat, 28 May 2011 13:56:54 +0000 (14:56 +0100)]
pp_formline: reduce indent in FF_LINEGLOB

change

    {
        block
    }

to

    block

(the diff looks more confusing than it actually is).

No code changes.

13 years agopp_formline: restruture FF_LINEGLOB
David Mitchell [Sat, 28 May 2011 13:52:41 +0000 (14:52 +0100)]
pp_formline: restruture FF_LINEGLOB

change

    if (linebreak) {
        decl;
        ....
    }

to
    decl;
    if (!linebreak)
        break;

    {
        ....
    }

shouldn't change the meaning of the code but will allow us to remove one
level of indentation and begin to reuse that block of code

13 years agopp_formline: combine two similar code chunks
David Mitchell [Fri, 27 May 2011 12:35:25 +0000 (13:35 +0100)]
pp_formline: combine two similar code chunks

FF_BLANK and FF_END do almost identical tidying up before returning

13 years agostop ~ in format modifying format string
David Mitchell [Thu, 26 May 2011 07:57:07 +0000 (08:57 +0100)]
stop ~ in format modifying format string

Currently, the format parser converts ~ or ~~ in a format string into
blank spaces. Since the previous-but-one commit, it only does it in a copy
rather than the original string, but this still defeats the "if the string
is the same don't recompile" mechanism.

Fix this by leaving the ~ alone in the format string, but instead cause
FF_LITERAL to convert '~' to ' ' when appending to the target.

Also, in S_doparseform(), improve the processing of '~~': previously
it only skipped one '~', and processed the second '~' on the next loop;
this happened to work, but it's less unexpected to process both chars at
once.

I've also added some tests, but these don't actually test whether the
format gets re-compiled: I couldn't think of a way to do that short of
checking the output of perl -Df. Instead the tests I added were based
around making sure I didn't break anything related to ~~ formatting.

I also improved the description string for some of the existing tests.

13 years agobetter document format code
David Mitchell [Wed, 25 May 2011 12:46:01 +0000 (13:46 +0100)]
better document format code

add descriptions of:
    format op constants
    local vars
    code blocks
to generally make navigating the format code easier.
(Oh, and fix one incorrect indent).

No code changes.

13 years agoRT #91032: formline: bugs with non-string formats
David Mitchell [Tue, 24 May 2011 16:08:51 +0000 (17:08 +0100)]
RT #91032: formline: bugs with non-string formats

When the format SV used by formline isn't a simple POK (such as
ties, overloads, or stringified refs), many many things go wrong,
and SEGVs ensue.

Originally, pp_formline forced the SV to a PV, and then assumed it could
rely on the resulting SvPVX value. Recent commits fixed this to
skip the force (good), but then broke things such as:

* in the absence of POK or pPOK, $^A was grown by 0 bytes rather than the
length of the format, so the buffer overran;

* the compiled format stored indexes into the original format string
  to refer to chunks of content text and the like. If there's no real
  SvPVX around, that's bad.

* Stuff like tie and overload could return different format strings on
  each get, but the format would not be re-compiled (but would index into
  the new string anyway)

Also, the format compiler would convert strings like '~~' into blanks
in the original format SV.

The easiest way to fix all these is to save a copy of the original string
at the time it is compiled. This can conveniently be stored in the mg_obj
slot of the fm magic (the compiled format already goes in mg_ptr).

This way we're always guaranteed to have an unadulterated copy of the
string to mess with.

Also, the ~~ self-modification now happens to the copy rather than the
original.

Now each time formline is called, we also compare the current value of the
SV with the stored copy, and if it's changed (e.g. tie with a FETCH that
returns different values each time), then we recompile.

Note that the recompile test is currently defeated by the ~~ modification,
so re-compiles unnecessarily (but safely) in that case. A fix for that is
coming next.

13 years agoMake sigblocking tests more independent
Leon Timmermans [Sun, 29 May 2011 10:59:49 +0000 (12:59 +0200)]
Make sigblocking tests more independent

On VMS, there seems to be a bug when using sigprocmask after sigsuspend.
This patch prevents that failure from cascading to the next couple of
tests.

13 years agoperlre: Fix some line wrap issues
Karl Williamson [Sat, 28 May 2011 22:19:39 +0000 (16:19 -0600)]
perlre: Fix some line wrap issues

This fixes some verbatim text exceeding an 80 column window by shortening
two =over amounts.

13 years agoperlre: Fix some line wrap issues
Karl Williamson [Sat, 28 May 2011 22:16:43 +0000 (16:16 -0600)]
perlre: Fix some line wrap issues

This fixes some issues with the pod wrapping verbatim in 80 column
windows by indenting less, and not having the comments so far to the
right

13 years agoperlre: Change C<> to L<>
Karl Williamson [Sat, 28 May 2011 22:04:03 +0000 (16:04 -0600)]
perlre: Change C<> to L<>

13 years agoperlrun: Add link to clarification
Karl Williamson [Sat, 28 May 2011 21:52:35 +0000 (15:52 -0600)]
perlrun: Add link to clarification

13 years agoUpgrade Data::Dumper to 2.131
Steffen Mueller [Sat, 28 May 2011 12:17:25 +0000 (14:17 +0200)]
Upgrade Data::Dumper to 2.131

This has no functional changes, just updating the version
and change log to match the stable CPAN release.

13 years agofeature.pm: Improve pod wording
Johan Vromans [Sat, 28 May 2011 02:57:58 +0000 (20:57 -0600)]
feature.pm: Improve pod wording

13 years ago[perl #72724] explicit return doesn’t work with lvalue subs
Father Chrysostomos [Fri, 27 May 2011 13:26:10 +0000 (06:26 -0700)]
[perl #72724] explicit return doesn’t work with lvalue subs

Now it does.

13 years agopodcheck.t: Guard against transitory files
Karl Williamson [Fri, 27 May 2011 14:28:59 +0000 (08:28 -0600)]
podcheck.t: Guard against transitory files

podcheck uses File::Find to look for pods in the directory structure.
It is possible for the Find to find a transitory file that is gone by
the time the file is opened for examination.  This patch will simply
skip the transitory file if the open fails and it's because it no longer
exists.  (There is a tiny window in which the open could fail, and
the file gets recreated and hence passes the exists test, but I'm not
bothering to code for that until it actually happens.)

13 years agoAdd more to-do tests for explicit return from lvalue sub
Father Chrysostomos [Fri, 27 May 2011 05:17:29 +0000 (22:17 -0700)]
Add more to-do tests for explicit return from lvalue sub

Commit 1c4274f4e11 added the first of these, copying them from the top
of the test script and adding ‘return’ to the functions, but it appar-
ently missed about 15.

13 years agoMove a test to the right file
Father Chrysostomos [Fri, 27 May 2011 05:01:07 +0000 (22:01 -0700)]
Move a test to the right file

sub_lval.t is for lvalue subs, not built-ins.

13 years agoregcomp.c: Fix memory leak regression
Nicholas Clark [Fri, 27 May 2011 04:29:40 +0000 (22:29 -0600)]
regcomp.c: Fix memory leak regression

There was a remaining memory leak in the new inversion lists data
structure under threading.  This solves it by changing the
implementation to use a SVpPV instead of doing our own memory
management.  Then the already existing code for handling SVs
returns the memory when done.

13 years agopodcheck.t: Add comment, explicit return
Karl Williamson [Thu, 26 May 2011 18:48:05 +0000 (12:48 -0600)]
podcheck.t: Add comment, explicit return

13 years agopodcheck.t: Skip broken symbolic links
Karl Williamson [Thu, 26 May 2011 18:39:30 +0000 (12:39 -0600)]
podcheck.t: Skip broken symbolic links

This stemmed from a build issue in some smokers.  The symbolic link 'U'
was left over.  If another type of file can't be opened, instead of
dying, this now just fails it as one test.

13 years agopodcheck.t: Skip some more non-pod files
Karl Williamson [Thu, 26 May 2011 18:35:42 +0000 (12:35 -0600)]
podcheck.t: Skip some more non-pod files

This skips editor droppings.

13 years agopodcheck.t: Force non-utf8 reading of files
Karl Williamson [Wed, 25 May 2011 19:15:27 +0000 (13:15 -0600)]
podcheck.t: Force non-utf8 reading of files

podcheck.t was failing when PERL_UNICODE was set to empty with
a UTF-8 locale, as it tried to read things in utf8 that aren't.
This led to a fatal malformed utf8 error.

This forces the :bytes layer when reading these files.

13 years ago[perl #91614] Suggestion for improving documentation of $!
John P. Linderman [Wed, 25 May 2011 15:36:27 +0000 (08:36 -0700)]
[perl #91614] Suggestion for improving documentation of $!

While trying to understand a bug report at

http://www.perlmonks.org/?node_id=906466

I realized that the documentation for $! was not crystal clear.  For example

    If used numerically, yields the current value of the
    C C<errno> variable, or in other words,
    if a system or library call fails, it sets this variable.

That's not "in other words", these are totally different
concepts.  And it isn't clear whether this variable refers to
errno or $! (I assumed the latter, and was wrong, as Devel::Peek
demonstrated).  And $! cannot be undef, as asserted (later),
because errno always contains a value, however irrelevant.

13 years agopodcheck.t: Skip files left by patch
Father Chrysostomos [Wed, 25 May 2011 03:19:55 +0000 (20:19 -0700)]
podcheck.t: Skip files left by patch

13 years ago[perl #90888] each(ARRAY) on scalar context should wrapped into defined()
Hojung Yoon [Wed, 25 May 2011 01:18:14 +0000 (18:18 -0700)]
[perl #90888] each(ARRAY) on scalar context should wrapped into defined()

"perldoc -f each" says that if each() is performed on ARRAY
in scalar context, it will return only the index in an array.
Calling each(HASH) in scalar context worked well but calling
each(ARRAY) didn't because it was not wrapped into defined OPCODE.

So, in Perl_newWHILEOP() and Perl_newLOOPOP(), they are modified
to check them and wrap with defined OP if needed.

In S_new_logop(), it's reasonable to warn if return value of
each(ARRAY) is being used for boolean value, as it's first return
value will be "0", the false.

issue: #90888
link: http://rt.perl.org/rt3/Public/Bug/Display.html?id=90888
13 years agoAdd Hojung Yoon to AUTHORS
Father Chrysostomos [Wed, 25 May 2011 01:17:45 +0000 (18:17 -0700)]
Add Hojung Yoon to AUTHORS

13 years agoIn Perl_pv_escape(), avoid reading 1 byte beyond the end of the buffer.
Nicholas Clark [Tue, 24 May 2011 20:37:26 +0000 (21:37 +0100)]
In Perl_pv_escape(), avoid reading 1 byte beyond the end of the buffer.

The check for whether to use 3 digits of octal was not correct, and was capable
of reading the byte beyond the passed in buffer. Except for the small
possibility that that byte was not mapped memory, it wouldn't change the
semantic correctness of the escaped output, but it would lead to
non-deterministic choice of which format to use.

13 years ago[perl #91518] Fix minor typo in pod/perlsub.pod.
Johan Vromans [Tue, 24 May 2011 15:35:37 +0000 (08:35 -0700)]
[perl #91518] Fix minor typo in pod/perlsub.pod.

13 years ago[perl #91508] __DATA__ starts reading on the next line
Johan Vromans [Tue, 24 May 2011 15:34:33 +0000 (08:34 -0700)]
[perl #91508] __DATA__ starts reading on the next line

In pod/perldata it is described that the DATA filehandle starts
reading after the __DATA__ token. In reality, it starts reading on the
line following the __DATA__ token.

Example:

print while <DATA>; __DATA__ foo
bar

This prints "bar", not "foo\nbar".

The attached patch fixes the documentation in pod/perldata.pod.

13 years agoImprove comments in sv.h describing SVrepl_EVAL and SVf_IVisUV.
Nicholas Clark [Tue, 24 May 2011 10:28:02 +0000 (11:28 +0100)]
Improve comments in sv.h describing SVrepl_EVAL and SVf_IVisUV.

13 years agoUn-TODO a test on Snow Leopard
Father Chrysostomos [Tue, 24 May 2011 03:18:24 +0000 (20:18 -0700)]
Un-TODO a test on Snow Leopard

Snow Leopard is Darwin 10, which compares less than 6 lexicographically.

13 years agopodcheck.t: Convert to Un*x style for file name eq
Karl Williamson [Mon, 23 May 2011 18:33:09 +0000 (12:33 -0600)]
podcheck.t: Convert to Un*x style for file name eq

The db keeps the file names stored in Un*x style.  Convert the
filenames returned by the OS into that style to get an apples
to apples comparison

13 years ago[perl #90850] Outdated Solaris pkg list on README.solaris
Claudio Ramirez [Mon, 23 May 2011 15:33:58 +0000 (08:33 -0700)]
[perl #90850] Outdated Solaris pkg list on README.solaris

The required packages for building perl on Solaris are outdated.
The complete list is only appliable to Solaris 8 (released in
February 2000, end of support in March 2009). The patch updates
the requirements for Solaris 9 and 10 (in short: dropping
no longer existant packages).

13 years agoAdd Claudio Ramirez to AUTHORS
Father Chrysostomos [Mon, 23 May 2011 15:33:48 +0000 (08:33 -0700)]
Add Claudio Ramirez to AUTHORS

13 years agoRestore cmpVERSION.pl's ability to spot differences in XS files.
Nicholas Clark [Fri, 20 May 2011 09:37:13 +0000 (10:37 +0100)]
Restore cmpVERSION.pl's ability to spot differences in XS files.

Since the refactor to use git tags (instead of a second source tree),
cmpVERSION.pl was only spotting differences in XS files if the corresponding
PM file was also modified. If only the XS file was modified, this was going
undetected.

Remove compare_git_file() - if git has already told us that a file differs,
there's no need to duplicate the work of comparison in Perl.

13 years agoFold Abigail's TAP generation logic back into cmpVERSION.pl
Nicholas Clark [Thu, 19 May 2011 19:24:14 +0000 (20:24 +0100)]
Fold Abigail's TAP generation logic back into cmpVERSION.pl

Reduce t/porting/cmp_version.t down to an invocation of cmpVERSION.pl with
--tap.

13 years agoChange the -x option of cmpVERSION.pl to exclude upstream ne 'blead'
Nicholas Clark [Thu, 19 May 2011 17:25:36 +0000 (18:25 +0100)]
Change the -x option of cmpVERSION.pl to exclude upstream ne 'blead'

Previously it was excluding if CPAN were true, which meant that anything
with a DISTRIBUTION was excluded, including files where blead is upstream,
and hence something we should fix.

13 years agoPass the git tag to cmpVERSION.pl with a --tag argument.
Nicholas Clark [Thu, 19 May 2011 17:00:37 +0000 (18:00 +0100)]
Pass the git tag to cmpVERSION.pl with a --tag argument.

If no tag is specified, default to git describe --abbrev=0.
(This is David Golden's suggestion, added t/porting/cmp_version.t in
3d92e8b1e4996571)

Eliminate the source_dir command line argument - this is now always assumed to
be '.'.

13 years agoConvert cmpVERSION.pl to Getopt::Long from Getopt::Std.
Nicholas Clark [Thu, 19 May 2011 16:22:43 +0000 (17:22 +0100)]
Convert cmpVERSION.pl to Getopt::Long from Getopt::Std.

13 years agoTrim the import list from File::Spec::Functions and don't use File::Find.
Nicholas Clark [Thu, 19 May 2011 15:55:06 +0000 (16:55 +0100)]
Trim the import list from File::Spec::Functions and don't use File::Find.

Most of the vestigial entries were caused by the refactoring to use git in
42e700c91cf83f56. Use File::Spec::Functions::devnull() in place of hard coded
values based on $^O.

13 years agoOnly load Maintainers.pm if cmpVERSION.pl is invoked with -x
Nicholas Clark [Thu, 19 May 2011 15:39:50 +0000 (16:39 +0100)]
Only load Maintainers.pm if cmpVERSION.pl is invoked with -x

Skip chdir $source_dir with -x, because -x checks that it's '.'

13 years agoRefactor podcheck.t to slurp files into scalars, instead of an array of lines.
Nicholas Clark [Mon, 23 May 2011 14:05:42 +0000 (15:05 +0100)]
Refactor podcheck.t to slurp files into scalars, instead of an array of lines.

Multiline matches in the regex engine are faster than looping and processing
in Perl space.

13 years agoIncorrect heading and index entries for (*MARK) in pod/perlre.pod
Johan Vromans [Mon, 23 May 2011 13:20:21 +0000 (06:20 -0700)]
Incorrect heading and index entries for (*MARK) in pod/perlre.pod

13 years agoCorrect and update the comments about FBMs in Perl_sv_2[inu]v_flags().
Nicholas Clark [Mon, 23 May 2011 11:10:15 +0000 (12:10 +0100)]
Correct and update the comments about FBMs in Perl_sv_2[inu]v_flags().

13 years agoAdd find2perl as a dependency for the target 'test_prep'.
Nicholas Clark [Mon, 23 May 2011 09:21:07 +0000 (10:21 +0100)]
Add find2perl as a dependency for the target 'test_prep'.

If t/porting/podcheck.t can't find x2p/find2perl, then it is unable to find an
external target for a pod link in perlutil.pod, which it flags up as an error.
find2perl was already a dependency of the 'all' target, hence without this
rule podcheck.t would pass for 'make all test', but not 'make test'.

13 years agoAdd another address for Sisyphus
Father Chrysostomos [Mon, 23 May 2011 06:23:29 +0000 (23:23 -0700)]
Add another address for Sisyphus

13 years ago[perl #91354] win32/makefile.mk needs patching for gcc-4.x.x
Sisyphus [Mon, 23 May 2011 06:15:30 +0000 (23:15 -0700)]
[perl #91354] win32/makefile.mk needs patching for gcc-4.x.x

The current win32/makefile.mk wants us to edit it when we are using
the gcc-4.x.x compiler. Firstly, we have to signify that we are using
gcc-4.x.x, then we have to nominate (from a supplied list) the name of
the helper dll that needs to be copied to the t folder (in order that
the taint.t tests can pass).

The supplied list of candidates is deficient - the name of the helper
dll from one of my gcc compilers is not listed there. Also, I'm now
finding that a second dll (libstdc++-6.dll) needs to be copied to the
t folder - otherwise the taint.t test still crashes.

The attached makefile.mk patch addresses these issues in such a way
that we don't have to do any editting (re the using of gcc-4.x.x) of
the makefile.mk at all.

There's a small discussion about this on the p5p mailing list in the
thread "win32/makefile.mk patch" (15 may 2011).

This change to the makefile.mk means that README.win32 needs a
slight modification - and the attached README.win32 patch addresses
that issue.

The README.win32 patch also alters the link to the 64-bit (mingw64)
compiler made available by kmx. This has nothing to do with the
subject of this bug report, but I don't see why that correction to
the link (as suggested to me by kmx, in private correspondence)
can't be made.

13 years agoTurn $$ into a magical readonly variable that always fetches getpid() instead of...
Max Maischein [Mon, 23 May 2011 04:36:57 +0000 (21:36 -0700)]
Turn $$ into a magical readonly variable that always fetches getpid() instead of caching it

The intent is that by not caching $$, we eliminate one opportunity for bugs:
If one embeds Perl or uses XS and calls fork(3) from C, Perls notion of $$
may go out of sync with what getpid() returns. By always fetching the
value of $$ via getpid(), this bug opportunity is eliminated. The overhead
of always fetching $$ should be small and is likely only used for tempfile
creation, which should be dwarfed by file system accesses.

13 years agoMake hash-rt85026.t less noisy
Father Chrysostomos [Mon, 23 May 2011 01:23:49 +0000 (18:23 -0700)]
Make hash-rt85026.t less noisy

13 years agopodcheck.t: Extract line numbers from strings properly
Karl Williamson [Mon, 23 May 2011 03:21:31 +0000 (21:21 -0600)]
podcheck.t: Extract line numbers from strings properly

There was a typo in this regex.  I added a \b for good measure.
This bug was currently showing up on VMS-only, where a string
was getting returned instead of a hash.  And the regex that
deals with strings had a typo, so wasn't matching.

It remains to be seen if there is an underlying issue on VMS that
was causing this error, and other OSs don't have it.

13 years agopodcheck.t: Skip perltoc
Karl Williamson [Mon, 23 May 2011 02:26:47 +0000 (20:26 -0600)]
podcheck.t: Skip perltoc

This pod is extracted from other pods, and the possible errors in those
extractions just keep propagating to this pod.  I tried to fix this
by having -1 entries in perltoc for the common errors which means
to not output them.  But new ones keep cropping up.  So, reluctantly,
I think it's best to just not process this file.

13 years agoPerl_refcounted_he_inc() needs a dVAR to compile with -DPERL_GLOBAL_STRUCT
Nicholas Clark [Thu, 28 Apr 2011 14:14:03 +0000 (15:14 +0100)]
Perl_refcounted_he_inc() needs a dVAR to compile with -DPERL_GLOBAL_STRUCT

13 years agoRestore building with -DPERL_GLOBAL_STRUCT, broken since 4dc941f7cb795735.
Nicholas Clark [Thu, 28 Apr 2011 13:36:15 +0000 (14:36 +0100)]
Restore building with -DPERL_GLOBAL_STRUCT, broken since 4dc941f7cb795735.

As PL_charclass is a constant, it doesn't need to be accessed via the global
struct. It should be exported via globvar.sym, not PERLVARA() in perlvars.h

[With a PERVARA() it all compiles perfectly, once C<dVAR>s are added where
now needed, but the build loops forever because the (real) charclass array is
never initialised]

13 years agoDowngrade Unicode pod escape to ASCII for readbility
Josh Jore [Sun, 22 May 2011 19:25:26 +0000 (12:25 -0700)]
Downgrade Unicode pod escape to ASCII for readbility

13 years agoregcomp.c: Another leak regression
Karl Williamson [Sun, 22 May 2011 16:51:40 +0000 (10:51 -0600)]
regcomp.c: Another leak regression

13 years agoFix deparsing of subs named :::: and ::::::
Father Chrysostomos [Sun, 22 May 2011 01:38:46 +0000 (18:38 -0700)]
Fix deparsing of subs named :::: and ::::::

Since a name like :::: is now divided up as ::/:: (since commit
088225f), there can be a package called ‘::’. But %:: returns %main::,
not %main::::. The result is that the main package is searched again
and again recursively and stash_subs hangs.

The easiest fix is to put main:: at the beginning of a substash’s name
when fetching the stash.

13 years agoTest require override with Deparse [perl #62500]
Father Chrysostomos [Sat, 21 May 2011 17:18:26 +0000 (10:18 -0700)]
Test require override with Deparse [perl #62500]

13 years agoGeneral perlfunc edit; document ‘default’
Tom Christiansen [Sat, 21 May 2011 12:19:09 +0000 (05:19 -0700)]
General perlfunc edit; document ‘default’

13 years agoRevert "Revert "Missing bug number in d12b49d""
Father Chrysostomos [Sat, 21 May 2011 05:08:42 +0000 (22:08 -0700)]
Revert "Revert "Missing bug number in d12b49d""

This reverts commit d33333ec9850d2a0f2f5466e207dcc612dc4dc31.

13 years agoIncrease constant’s version
Father Chrysostomos [Sat, 21 May 2011 05:07:50 +0000 (22:07 -0700)]
Increase constant’s version
in preparation for the next commit

13 years agoMove an assert
Father Chrysostomos [Sat, 21 May 2011 05:06:35 +0000 (22:06 -0700)]
Move an assert

Due to my own sloppy editing, this assert ending up doing nothing,
as perl would already have crashed before reaching it.

13 years agoWhat’s wrong with me?
Father Chrysostomos [Sat, 21 May 2011 03:29:46 +0000 (20:29 -0700)]
What’s wrong with me?

13 years agoRemove fixed bug from Deparse’s docs
Father Chrysostomos [Fri, 20 May 2011 23:43:11 +0000 (16:43 -0700)]
Remove fixed bug from Deparse’s docs

13 years agoMake Deparse use CORE:: when necessary
Father Chrysostomos [Fri, 20 May 2011 23:40:01 +0000 (16:40 -0700)]
Make Deparse use CORE:: when necessary

Till now, Deparse has not added CORE:: to built-in keywords, even when
they are overridden by subs.  Now it does.

It was simply a matter of adding a ‘keyword’ sub that looks in the
current stash to determine whether there is a possible override.  And
it only does so for overridable non-infix functions.  It returns the
keyword with CORE:: added to the beginning if necessary.  Various
parts of the code have been modified to call this routine.

13 years agopodcheck.t: Improve VMS abilities
Karl Williamson [Fri, 20 May 2011 22:10:29 +0000 (16:10 -0600)]
podcheck.t: Improve VMS abilities

This should solve many of the problems encountered on VMS.  It does
it by lower-casing file names before comparison.

13 years agoDeparse: readpipe with complex expression
Father Chrysostomos [Fri, 20 May 2011 21:03:41 +0000 (14:03 -0700)]
Deparse: readpipe with complex expression

readpipe was always being deparse as `...` or qx.

This commit changes it to use the already-existing pure_string routine
to determine whether it can fit in `` first.

13 years agoregcomp.c: Another memory leak regression
Karl Williamson [Fri, 20 May 2011 16:54:22 +0000 (10:54 -0600)]
regcomp.c: Another memory leak regression

The reference count should be decremented upon freeing.

13 years ago[perl #91008] Deparse doesn't like each $ref
Father Chrysostomos [Fri, 20 May 2011 16:28:51 +0000 (09:28 -0700)]
[perl #91008] Deparse doesn't like each $ref

13 years agoBump Attribute::Handlers version to 0.91
Steffen Mueller [Fri, 20 May 2011 15:57:50 +0000 (17:57 +0200)]
Bump Attribute::Handlers version to 0.91

... to match the CPAN version.

No functional changes.

13 years agoBump/upgrade Filter::Simple version to 0.87
Steffen Mueller [Fri, 20 May 2011 15:54:48 +0000 (17:54 +0200)]
Bump/upgrade Filter::Simple version to 0.87

... to match CPAN release.

No functional changes.

13 years agoFix skip() usage in tests
Steffen Mueller [Fri, 20 May 2011 14:03:07 +0000 (16:03 +0200)]
Fix skip() usage in tests

It needs to know how many tests to skip. This never failed in
blead since it's perl version dependent.

13 years agopodcheck.t: Fully qualify carp call from package
Karl Williamson [Fri, 20 May 2011 14:27:02 +0000 (08:27 -0600)]
podcheck.t: Fully qualify carp call from package

13 years agopodcheck.t: Deal properly with -1 counts
Karl Williamson [Fri, 20 May 2011 03:31:35 +0000 (21:31 -0600)]
podcheck.t: Deal properly with -1 counts

These counts are for things like perltoc which are compendiums of other
pods, and so contain any errors in those other pods, which should be
output with the offending pod and not perltoc.  By setting the counts of
errors to a negative in the db, the message for perltoc is suppressed.
But a message was getting improperly output with perltoc when the
original pod got fixed.

13 years agoutf8.c: revise comment
Karl Williamson [Fri, 20 May 2011 03:10:15 +0000 (21:10 -0600)]
utf8.c: revise comment

13 years agoFilename portability for hash-rt85026.t
Craig A. Berry [Fri, 20 May 2011 12:36:53 +0000 (07:36 -0500)]
Filename portability for hash-rt85026.t

File::Temp::tempdir returns a directory in native syntax.  You
can't just paste a file onto that in Unix syntax and expect it
to work.

13 years agoif List-Util is built statically, depend on $(PERL_EXE) instead of the shared library
Tony Cook [Tue, 29 Mar 2011 11:15:23 +0000 (22:15 +1100)]
if List-Util is built statically, depend on $(PERL_EXE) instead of the shared library

of course, it could be that these dependencies are as redundant as the
rest.

13 years agoremove unused dependency rule generation for Text/ParseWords
Tony Cook [Tue, 29 Mar 2011 10:42:48 +0000 (21:42 +1100)]
remove unused dependency rule generation for Text/ParseWords

1) Text/ParseWords isn't XS, so never appears in dynamic_ext

2) there's no lib/auto/Scalar/Util.$dlext target, the file would be
lib/auto/Scalar/Util/Util.$dlext , but it's built as part of
List-Util, so there's no dependency lib/auto/Scalar/Util/Util.$dlext
anyway.

13 years agohandle a static Cwd when generating the deps for x2p/utils
Tony Cook [Tue, 29 Mar 2011 10:32:52 +0000 (21:32 +1100)]
handle a static Cwd when generating the deps for x2p/utils