platform/upstream/perl.git
13 years agoIncrease Sys::Hostname’s version
Father Chrysostomos [Thu, 28 Oct 2010 05:56:37 +0000 (22:56 -0700)]
Increase Sys::Hostname’s version

13 years agoRevert "Bump charnames’ version"
Father Chrysostomos [Thu, 28 Oct 2010 05:55:13 +0000 (22:55 -0700)]
Revert "Bump charnames’ version"

This reverts commit fc7c69e2154d208e45cf3f5c98b74ed035d8f50c.

13 years agoRun 01SelfLoader.t also under taint mode
Father Chrysostomos [Thu, 28 Oct 2010 05:16:37 +0000 (22:16 -0700)]
Run 01SelfLoader.t also under taint mode

This is to test for [perl #72062].

13 years agoMark failing tests in t/op/stash.t as to-do
Father Chrysostomos [Thu, 28 Oct 2010 04:49:03 +0000 (21:49 -0700)]
Mark failing tests in t/op/stash.t as to-do

Commit 78b79c775, in adding test for the breakage introduced in
35759254, inadvertently triggered a bug that goes back at least to
perl 5.8.7, but which only occurs with threads.

13 years agofix pod formatting in perldelta.pod
David Golden [Wed, 27 Oct 2010 22:34:11 +0000 (18:34 -0400)]
fix pod formatting in perldelta.pod

13 years agoperldelta up to 157486ae134392
Father Chrysostomos [Wed, 27 Oct 2010 20:46:13 +0000 (13:46 -0700)]
perldelta up to 157486ae134392

13 years agoIncrease SDBM_File’s version
Father Chrysostomos [Wed, 27 Oct 2010 20:43:05 +0000 (13:43 -0700)]
Increase SDBM_File’s version

13 years agoIncrease Hash::Util’s version
Father Chrysostomos [Wed, 27 Oct 2010 20:41:02 +0000 (13:41 -0700)]
Increase Hash::Util’s version

13 years agoIncrease Fcntl’s version
Father Chrysostomos [Wed, 27 Oct 2010 20:28:38 +0000 (13:28 -0700)]
Increase Fcntl’s version

13 years agoperldelta up to 582b18310
Father Chrysostomos [Wed, 27 Oct 2010 19:59:24 +0000 (12:59 -0700)]
perldelta up to 582b18310

13 years agoBump ODBM_File’s version
Father Chrysostomos [Wed, 27 Oct 2010 19:52:56 +0000 (12:52 -0700)]
Bump ODBM_File’s version

13 years agoBump NDBM_File’s version
Father Chrysostomos [Wed, 27 Oct 2010 19:51:50 +0000 (12:51 -0700)]
Bump NDBM_File’s version

13 years agoRemove THREADSV_NAMES, part of 5005 threads that the chainsaw missed.
Nicholas Clark [Wed, 27 Oct 2010 20:25:54 +0000 (22:25 +0200)]
Remove THREADSV_NAMES, part of 5005 threads that the chainsaw missed.

Also remove the documentation of OPf_SPECIAL for OP_ENTERITER, as that was only
for 5.005 threads. Stop B::Deparse misinterpreting OPf_SPECIAL on OP_ENTERITER.

13 years agoB::Deparse should call B::threadsv_names, instead of hard coding a list.
Nicholas Clark [Wed, 27 Oct 2010 20:14:06 +0000 (22:14 +0200)]
B::Deparse should call B::threadsv_names, instead of hard coding a list.

These are only used under 5.005threads, which was removed in 5.10.

13 years agoGet B::Deparse to load on perls back to 5.8.1
Nicholas Clark [Wed, 27 Oct 2010 19:37:44 +0000 (21:37 +0200)]
Get B::Deparse to load on perls back to 5.8.1

But note - not all its tests are parsing, and some routines will fail at runtime
due to methods missing from older Bs.

13 years agoRenaming of stashes should not be visible from Perl
Father Chrysostomos [Wed, 27 Oct 2010 16:44:04 +0000 (09:44 -0700)]
Renaming of stashes should not be visible from Perl

Change 35759254 made stashes get renamed when moved around. This had
an unintended consequence: Typeglobs, ref() return values, stringifi-
cation of blessed references and __PACKAGE__ are all affected by this.

This commit makes a new distinction between stashes’ names and effect-
ive names. Stash names are now unaffected when the stashes move
around. Only the effective names are affected. (The apparent presence
of any puns in the previous sentence is purely incidental and most
likely the result of the reader’s inferential propensity.)

To this end a new HvENAME_get macro is introduced, returning the first effective name (what HvNAME_get was returning). (Only one effective
name needs to be in effect at a time.) hv_add_name and hv_delete_name
have been renamed hv_add_ename and hv_delete_ename. hv_name_set is
modified to leave the effective names in place unless the name is
being set to NULL.

These names are now stored in HvAUX as follows: When xhv_name_count is
0, xhv_name is a HEK pointer, containing the name which is also the
effective name. When xhv_name_count is not zero, then xhv_name is a
pointer to an array of HEK pointers. If xhv_name_count is positive,
the first HEK is the name *and* one of the effective names. When
xhv_name_count is negative, the first HEK is the name and subsequent
HEKs are the effective names.

13 years agoSimplify the conditionals in the XS code for B::COP::{io,warnings}
Nicholas Clark [Wed, 27 Oct 2010 16:16:27 +0000 (17:16 +0100)]
Simplify the conditionals in the XS code for B::COP::{io,warnings}

The same post-processed C code will generated as before for PERL_VERSION >= 9,
and the same sequence of perl API calls for PERL_VERSION < 9.

13 years agoUpdate UPSTREAM status for perlreftut and Tie::File in Maintainers.pl
Chris 'BinGOs' Williams [Wed, 27 Oct 2010 15:08:58 +0000 (16:08 +0100)]
Update UPSTREAM status for perlreftut and Tie::File in Maintainers.pl

  From IRC logs:

  [16:05] <yrlnry> Tie::File can be marked first-come.
  [16:06] <yrlnry> perlreftut can be marked 'blead' since there is no CPAN version.
  [16:06] <yrlnry> perlreftut has required only very rate changes, which are easily handled by sending patch files to the pumpkings.

13 years agoUsing ALIAS B::OP::{opt,spare,type} can be implemented as 1 XS function.
Nicholas Clark [Wed, 27 Oct 2010 14:21:40 +0000 (15:21 +0100)]
Using ALIAS B::OP::{opt,spare,type} can be implemented as 1 XS function.

This reduces the object code size by almost 2K on this platform.

13 years agoDon't fold constants in sprintf() if locales are used
Niko Tyni [Wed, 27 Oct 2010 07:56:24 +0000 (10:56 +0300)]
Don't fold constants in sprintf() if locales are used

Commit c427f4d2d4575fbc8a5190932fe321136c7597b3 in 5.10.1 made sprintf()
ignore LC_NUMERIC for numeric constants.

13 years agoLC_NUMERIC documentation updates + tests
Niko Tyni [Tue, 19 Oct 2010 18:55:14 +0000 (21:55 +0300)]
LC_NUMERIC documentation updates + tests

Most of the confusion around LC_NUMERIC was fixed with commits
7e4353e96785be675a69a6886d154405dbfdc124 and
2095dafae09cfface71d4202b3188926ea0ccc1c
but two errors remain:

- the early parts of perllocale.pod still say printf() uses LC_NUMERIC
  with just 'use locale' when actually a POSIX::setlocale() call is
  also needed

- format() hasn't used LC_NUMERIC unconditionally since 5.005_03
  (commit 097ee67dff1c60f201bc09435bc6eaeeafcd8123).

Update the documentation and test the claims in t/run/locale.t.

13 years agoRefactor LC_NUMERIC test out of t/run/fresh_perl.t
Niko Tyni [Wed, 27 Oct 2010 06:49:38 +0000 (09:49 +0300)]
Refactor LC_NUMERIC test out of t/run/fresh_perl.t

Neither lib/locale.t nor t/run/fresh_perl.t should be used for new tests,
so take the locale related tests and the setup code from fresh_perl.t
to make ground for more.

13 years agoUpdate Archive-Extract to CPAN version 0.46
Chris 'BinGOs' Williams [Wed, 27 Oct 2010 11:09:43 +0000 (12:09 +0100)]
Update Archive-Extract to CPAN version 0.46

  [DELTA]

  Changes for 0.46    Tue Oct 26 23:45:52 2010
  ============================================
  * Correct speeling errors in docs, spotted by
    Avar
  * Only use unzip from /usr/pkg/bin when on
    NetBSD which will be the Info-ZIP version

13 years agonew API functions op_scope and op_lvalue
Zefram [Tue, 26 Oct 2010 22:58:42 +0000 (23:58 +0100)]
new API functions op_scope and op_lvalue

The function scope() goes into the API as op_scope(), and mod() goes
into the API as op_lvalue().  Both marked experimental, because their
behaviour is a little quirky and not trivially dequirkable.

13 years agoANYOF regnode often overallocates space
Karl Williamson [Tue, 26 Oct 2010 19:14:12 +0000 (13:14 -0600)]
ANYOF regnode often overallocates space

The ANYOF regnode is used for [bracketed character classes].  It is
normally a struct regnode_charclass, but sometimes it is a struct
regnode_charclass_class, which adds an extra 4 bytes at the end to store
which of things like \d, \w, [:posix:] within the outer bracketed class
are to be matched at run time, like [\d\s[:upper:]].

However these are currently only stored the if the match is to be locale
based.  I haven't looked in the history, but the comments seem to
indicate that in the past those things were stored there all the time.

But, the space is allocated even if nothing gets stored there.  This
patch only allocates the space if there is one of these classes
occurring in a [bracketed class] and something is stored there, namely
only if the regex is being compiled under 'use locale'.

The previous code was not noting that these classes matched code points
(in the 'stored' variable), but was relying on ANYOF_LARGE getting set
which thus avoided it thinking it was a single character class that
could be optimized to an EXACT node.  Thus, this patch has to explicitly
set 'stored' to > 1, as the function already does elsewhere for similar
reasons.

13 years agoCleanup output from t/io/defout.t RT#78572
Jerry D. Hedden [Tue, 26 Oct 2010 22:58:55 +0000 (15:58 -0700)]
Cleanup output from t/io/defout.t RT#78572

t/io/defout.t pollutes the output of 'make test':

  t/io/defout....................................................$a;
  # write
  ok

  The attached patch fixes this.

13 years agoRevert "[PATCH] Cleanup output from t/io/defout.t RT#78572"
Father Chrysostomos [Tue, 26 Oct 2010 22:57:06 +0000 (15:57 -0700)]
Revert "[PATCH] Cleanup output from t/io/defout.t RT#78572"

This reverts commit 4d2eb54d4d30c9c5b093de9a57c324d5551c58fe.

13 years ago[PATCH] Cleanup output from t/io/defout.t RT#78572
Jerry D. Hedden [Tue, 26 Oct 2010 21:11:32 +0000 (22:11 +0100)]
[PATCH] Cleanup output from t/io/defout.t RT#78572

  t/io/defout.t pollutes the output of 'make test':

  t/io/defout....................................................$a;
  # write
  ok

  The attached patch fixes this.

Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
13 years agofix thinko in code comment
David Mitchell [Tue, 26 Oct 2010 16:07:57 +0000 (17:07 +0100)]
fix thinko in code comment

13 years agoUpdate CPAN to CPAN version 1.94_62
Chris 'BinGOs' Williams [Tue, 26 Oct 2010 13:41:47 +0000 (14:41 +0100)]
Update CPAN to CPAN version 1.94_62

  [DELTA]

  2010-10-26  Andreas J. Koenig  <andk@cpan.org>

        * release 1.94_62

        * address RT #62064: build_requires_install_policy set to "no" did not
        work correctly (reported by Xavier Bergade)

        * address RT ##55091: don't ask the proxy credentials if proxy_user
        empty (fixed by Robert Bohne)

        * address RT #55093: no_proxy doesn't work with more then one entries
        (fixed by Robert Bohne)

13 years agodetect the failure introduced in 304474c3 and fixed in cefd5c7c
Tony Cook [Tue, 26 Oct 2010 12:09:45 +0000 (23:09 +1100)]
detect the failure introduced in 304474c3 and fixed in cefd5c7c

13 years agoIn I18N::Langinfo::langinfo(), use newSVpv(), as it will call strlen()
Nicholas Clark [Tue, 26 Oct 2010 04:50:14 +0000 (05:50 +0100)]
In I18N::Langinfo::langinfo(), use newSVpv(), as it will call strlen()

newSVpv() will return an undef if the passed pointer is NULL, which allows
langinfo() to be simplified further.

13 years ago-$zero should not modify $zero
Father Chrysostomos [Tue, 26 Oct 2010 04:29:24 +0000 (21:29 -0700)]
-$zero should not modify $zero

With change a5b92898, negation started modifying numeric arguments,
causing problems for modules like Data::Float.

13 years agoCorrectly set param->new_perl in perl_clone_using()
Jan Dubois [Tue, 26 Oct 2010 01:35:19 +0000 (18:35 -0700)]
Correctly set param->new_perl in perl_clone_using()

13 years agoCorrect spelling
Father Chrysostomos [Tue, 26 Oct 2010 00:58:45 +0000 (17:58 -0700)]
Correct spelling

I misspelt lopadotemachoselachogaleokranioleipsanodrimypotrimmatosilphiokarabomelitokatakechymenokichlepikossyphophattoperisteralektryonoptokephalliokinklopeleiolagoiosiraiobaphetraganopterygon.

13 years agoRemove the to-do mark from test 4 in threads-dirh.t
Father Chrysostomos [Tue, 26 Oct 2010 00:56:48 +0000 (17:56 -0700)]
Remove the to-do mark from test 4 in threads-dirh.t

13 years agoadd CvSTASH_set() macro and make CvSTASH() rvalue only
Zefram [Mon, 25 Oct 2010 22:34:23 +0000 (23:34 +0100)]
add CvSTASH_set() macro and make CvSTASH() rvalue only

Now that CvSTASH requires backreference bookkeeping, stop people from
directly assigning to it (by using CvSTASH() as an lvalue), and instead
force them to use CvSTASH_set().

13 years agoDocument rewinddir() limitations
Jan Dubois [Mon, 25 Oct 2010 23:43:51 +0000 (16:43 -0700)]
Document rewinddir() limitations

as well as the similar limitations of directory handles that
have been open while calling the fork() emulation on Windows.

13 years agoFix @ISA recursion during global destruction
Father Chrysostomos [Mon, 25 Oct 2010 21:48:56 +0000 (14:48 -0700)]
Fix @ISA recursion during global destruction

With -DDEBUGGING and make test (not make test_harness):

Failed 3 tests out of 1889, 99.84% okay.
mro/basic.t
mro/recursion_c3.t
mro/recursion_dfs.t

See <http://www.nntp.perl.org/group/perl.perl5.porters/2010/10/msg165311.html>.

This was broken by change 35759254, which made S_hv_delete_common call
mro_package_moved when the G_DISCARD flag was passed. It used to be
skipped, which was a mistake.

This commit simply skips mro_package_moved when $::{"main::"} is
deleted. It was buggy anyway (main::E being passed to recursive calls,
instead of E), and should only happen at global destruction. (If
$::{"main::"} is deleted at run-time, it stop Perl from being func-
tional, so no one should be doing that.)

13 years agoImplement DIR* cloning on Windows
Jan Dubois [Mon, 25 Oct 2010 22:50:27 +0000 (15:50 -0700)]
Implement DIR* cloning on Windows

There doesn't seem to be a mechanism to clone FileFind handles on
Windows.  Therefore this implementation just reads all remaining
entries into a cache buffer and closes the handle.  All further
readdir() requests will be fulfilled from the cache buffer, in both
the original and the new interpreter.

This fixes bug 75154 on Windows (all tests in t/op/threads-dirh.t pass).

This commit also changes the return value of win32_telldir() to -1
for directory handles that have been read until the end.  The previous
return value was (NULL - dirp->start), which technically is not
valid C code.

API change alert: Perl_dirp_dup() gets an additional CLONE_PARAMS
parameter in this change (like all the other Perl_*_dup() functions).

13 years ago[perl #77812] Globs in tied scalars can be reified if STORE dies
Father Chrysostomos [Mon, 25 Oct 2010 21:21:57 +0000 (14:21 -0700)]
[perl #77812] Globs in tied scalars can be reified if STORE dies

This commit just adds tests. This was fixed by 2acc3314e31a9.

13 years agoRevert "Fix for RT#1804: Anonymous glob breaks when assigned through"
Father Chrysostomos [Mon, 25 Oct 2010 21:20:57 +0000 (14:20 -0700)]
Revert "Fix for RT#1804: Anonymous glob breaks when assigned through"

This reverts commit 0fe688f528b0e1b5bef6fb30d5e45316430e8a41, except
for the tests.

It is no longer necessary, as of change 2acc3314e31a9. Another reason
for this revert is that doing so fixes bug #77812, or at least it
would if 2acc3314e31a9 had not fixed that, too.

13 years agoMake untie check the FAKE flag on globs
Father Chrysostomos [Mon, 25 Oct 2010 19:28:33 +0000 (12:28 -0700)]
Make untie check the FAKE flag on globs

This allows untie($scalar) to untie the scalar if the last assigned or
returned happened to be a typeglob.

13 years agoIn Socket::inet_ntoa(), use Perl_newSVpvf(), instead of sprintf and newSVpvn*.
Nicholas Clark [Mon, 25 Oct 2010 19:43:57 +0000 (20:43 +0100)]
In Socket::inet_ntoa(), use Perl_newSVpvf(), instead of sprintf and newSVpvn*.

13 years agofunction to parse isolated label
Zefram [Sun, 24 Oct 2010 04:44:43 +0000 (05:44 +0100)]
function to parse isolated label

New API function parse_label() parses a label, separate from statements.
If a label has not already been lexed and queued up, it does not use
yylex(), but parses the label itself at the character level, to avoid
unwanted lexing past an absent optional label.

13 years agofunction to parse unlabelled statement
Zefram [Sun, 24 Oct 2010 02:13:39 +0000 (03:13 +0100)]
function to parse unlabelled statement

New API function parse_barestmt() parses a pure statement, with no label,
and returns just the statement's core ops, not attaching a state op.

13 years agostop passing line numbers into op constructor functions
Zefram [Sat, 23 Oct 2010 14:40:58 +0000 (15:40 +0100)]
stop passing line numbers into op constructor functions

Remove the line number parameter from newWHILEOP() and newFOROP()
functions.  Instead, the line number for the impending COP is set by
parser code after constructing the ops.  (In fact the parser was doing
this anyway in most cases.)  This brings newWHILEOP() and newFOROP()
in line with the other op constructors, in that they do not concern
themselves with COPs.

13 years agorefactor and regularise label/statement grammar
Zefram [Tue, 19 Oct 2010 20:16:11 +0000 (21:16 +0100)]
refactor and regularise label/statement grammar

Refactoring of the grammar around statements.  New production <barestmt>
encompasses a statement without label.  It includes all statement types,
including declarations, with no unnecessary intermediate non-terminals.
It generates an op tree for the statement's content, with no leading
state op.  The <fullstmt> production has just one rule, consisting of
optional label followed by <barestmt>.  It puts a state op on the front
of the statement's content ops.

To support the regular statement op structure, the op sequence for for(;;)
loops no longer has a second state op between the initialisation and
the loop.  Instead, the unstack op type is slightly adapted to achieve
the stack clearing without a state op.

The newFOROP() constructor function no longer generates a state op,
that now being the job of the <fullstmt> production.  Consequently it
no longer takes a parameter stating what label is to go in the state op.
This brings it in line with the other op constructors.

13 years agoMerge Hash::Util::FieldHash::_test_uvar_{get,set,same} using ALIAS.
Nicholas Clark [Mon, 25 Oct 2010 19:21:50 +0000 (20:21 +0100)]
Merge Hash::Util::FieldHash::_test_uvar_{get,set,same} using ALIAS.

On this platform it reduces the object code size by over 1K.
Ideally these test functions would not be in the installed code, but I can't
see an easy way to avoid this.

13 years agoIn Hash::Util::FieldHash::_test_uvar_set, the second SvRV(sverf) is not needed.
Nicholas Clark [Mon, 25 Oct 2010 19:06:36 +0000 (20:06 +0100)]
In Hash::Util::FieldHash::_test_uvar_set, the second SvRV(sverf) is not needed.

13 years ago[perl #77688] tie $scalar can tie a handle
Father Chrysostomos [Mon, 25 Oct 2010 17:52:42 +0000 (10:52 -0700)]
[perl #77688] tie $scalar can tie a handle

Make tie() distinguish between $scalar and *$scalar when $scalar holds
a glob copy, by checking the FAKE flag.

13 years agoTests for [perl #77508] List assignment to fake globs fails
Father Chrysostomos [Mon, 25 Oct 2010 17:04:29 +0000 (10:04 -0700)]
Tests for [perl #77508] List assignment to fake globs fails

This was fixed by 2acc3314e31a9.

13 years ago[perl #77498] Assignment ignores magick when the RHS holds a glob
Father Chrysostomos [Mon, 25 Oct 2010 17:00:47 +0000 (10:00 -0700)]
[perl #77498] Assignment ignores magick when the RHS holds a glob

13 years agoFor PROXYSUBS, tables may sometimes have no entries.
Jan Dubois [Mon, 25 Oct 2010 17:23:04 +0000 (10:23 -0700)]
For PROXYSUBS, tables may sometimes have no entries.

The reason being that all entries in the tables are guarded
with #ifdef, so if none of the symbols are defined, then we
still end up with an empty table.  This actually happens in
the POSIX module on Windows for the "yes" table.

This reverts commit c553cca0 and changes based on it.

13 years agoIn FastCalc.xs, use SV * as the return type for _new() and _zero()
Nicholas Clark [Mon, 25 Oct 2010 13:53:19 +0000 (14:53 +0100)]
In FastCalc.xs, use SV * as the return type for _new() and _zero()

Previously these were using AV *. Whilst the code always was managing
references correctly, to work around the deficiency of the standard typemap
entry for AV * it had to mortalise the array it created, meaning that it was
creating 2 entries per call on the mortals stack, not 1.

13 years agort #72398 - get magic before downgrading in SvPVbyte()
Tony Cook [Mon, 25 Oct 2010 11:59:59 +0000 (22:59 +1100)]
rt #72398 - get magic before downgrading in SvPVbyte()

13 years agoTODO test: SvPVbyte should handle get magic before checking the utf8 flag
Niko Tyni [Mon, 25 Oct 2010 11:37:49 +0000 (22:37 +1100)]
TODO test: SvPVbyte should handle get magic before checking the utf8 flag

When $1 had the utf8 flag set from a previous match, SvPVbyte
may croak with 'Wide character in subroutine entry' before
resetting the flag to its new value.

Add a support function and a TODO test for this in XS-APItest.

http://bugs.debian.org/376329

13 years agoConvert Math::BigInt::FastCalc to XSLoader.
Nicholas Clark [Mon, 25 Oct 2010 09:09:09 +0000 (10:09 +0100)]
Convert Math::BigInt::FastCalc to XSLoader.

As the minimum perl version is 5.006, enable 'use warnings'.

13 years agoIn FastCalc.xs, inline the macros CONSTANT_OBJ and RETURN_MORTAL_BOOL.
Nicholas Clark [Mon, 25 Oct 2010 08:53:44 +0000 (09:53 +0100)]
In FastCalc.xs, inline the macros  CONSTANT_OBJ and RETURN_MORTAL_BOOL.

With the previous commit, both are now only used in one place.
No need to use sv_2mortal() on the reset of boolSV(), as both PL_sv_no and
PL_sv_yes are immortals. [And special-cased within the implementation of
sv_2mortal() - not only is it a no-op, it's a non-free no-op :-)]

13 years agoReduce repetition in FastCalc.xs by using ALIASes.
Nicholas Clark [Mon, 25 Oct 2010 08:24:06 +0000 (09:24 +0100)]
Reduce repetition in FastCalc.xs by using ALIASes.

_one, _two and _ten are aliases to _zero
_is_odd is an alias of _is_even
_is_one, _is_two, _is_ten are aliases of _is_zero

On this system this reduces the object code size by about 4.5K (about 20%).

13 years agoMove some GV tests to gv.t from glob.t - the latter is for testing glob()
Nicholas Clark [Mon, 25 Oct 2010 07:54:07 +0000 (08:54 +0100)]
Move some GV tests to gv.t from glob.t - the latter is for testing glob()

They were incorrectly added to glob.t by 010be86bae505fbe.

13 years agoStop sysio.t changing into t/op, and hence creating a temporary file there.
Nicholas Clark [Mon, 25 Oct 2010 07:51:55 +0000 (08:51 +0100)]
Stop sysio.t changing into t/op, and hence creating a temporary file there.

Creating a file there causes a race condition with (at least) glob.t, which
lists the contents of t/op by various means, and compares the results for
consistency.

13 years agoCorrect tests for B::{cstring,perlstring,cchar}
Nicholas Clark [Mon, 25 Oct 2010 07:46:53 +0000 (08:46 +0100)]
Correct tests for B::{cstring,perlstring,cchar}

Fix a Perl precedence error that prevented several test cases for cchar() from
being run. As a result, fix those test cases.

Fix an ASCII assumption in the tests common to cstring() and perlstring().
(chr 127 is " on EBCDIC, which is most definitely printable, so won't be
replaced with octal there.)

13 years agoRename stashes when they move around
Father Chrysostomos [Mon, 25 Oct 2010 06:45:49 +0000 (23:45 -0700)]
Rename stashes when they move around

This is yet another patch in preparation for [perl #75176] (I keep
saying that.).

It uses the recently-added functions hv_name_add and hv_name_delete, to add and remove names when mro_package_moved is called.

mro_package_moved’s calling convention needed to change to make this
work, which is the bulk of the patch.

Code that was calling mro_package_moved was also doing it sometimes
when it was unnecessary. If the stash being assigned over had no name,
then there was no possibiiity of its being in the symbol table.

This probably fixes [perl #77358] (isa warnings), though I have not
tested that yet.

One user-visible change this introduces is that a detached glob whose
stash loses its name will no longer stringify the same way (a bit like
a glob that loses its stash pointer; except that it becomes
*__ANON__::foo instead of "").

13 years agoMemory-management macros evaluate their arguments multiple times
Father Chrysostomos [Mon, 25 Oct 2010 01:39:25 +0000 (18:39 -0700)]
Memory-management macros evaluate their arguments multiple times

13 years ago[perl #77496] tied gets scalars and globs confused
Father Chrysostomos [Mon, 25 Oct 2010 01:14:47 +0000 (18:14 -0700)]
[perl #77496] tied gets scalars and globs confused

Make pp_tied use the SvFAKE flag to distinguish between tied scalars
and tied handles. This is now possible as of change 2acc3314.

This fixes the problem of tied($scalar) ignoring the tie if the last
thing returned or assigned happened to be a glob.

13 years agouse compatible types in a conditional expression
Tony Cook [Mon, 25 Oct 2010 00:04:23 +0000 (11:04 +1100)]
use compatible types in a conditional expression

With some compilers NULL is ((void *)0) which isn't type compatible
with the integer returned by hv_exists_ent().

13 years ago[perl #77810] Scalars vs globs
Father Chrysostomos [Sun, 24 Oct 2010 22:50:23 +0000 (15:50 -0700)]
[perl #77810] Scalars vs globs

Stop *{} from returning globs with the SVf_FAKE flag on.

It removes three tests from t/op/gv.t (that I added) that test buggy
edge cases that can no longer occur.

It also modifies tests in t/io/defout.t to keep them passing. I am not
sure that test script serves any purpose any more.

13 years agoUpdate Locale-Maketext to CPAN version 1.17
Todd Rinaldo [Sun, 24 Oct 2010 23:01:31 +0000 (00:01 +0100)]
Update Locale-Maketext to CPAN version 1.17

  [DELTA]

  2010-10-20
    * Release 1.17

    Test release of 1.16_01, versioning even deprecated Guts modules.
    This prevents CPAN upgrade circular heck. Thanks BinGOs

    Tested version fix for CPAN by BinGOs. Bump to stable version and release to public

Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
13 years agoUpdate Maintainers.pl with the latest version of Module::CoreList
Chris 'BinGOs' Williams [Sun, 24 Oct 2010 21:02:21 +0000 (22:02 +0100)]
Update Maintainers.pl with the latest version of Module::CoreList

13 years agoIn B.xs, use newSVpvn_flags() instead of sv_newmortal() and sv_setpvn().
Nicholas Clark [Sun, 24 Oct 2010 18:13:10 +0000 (19:13 +0100)]
In B.xs, use newSVpvn_flags() instead of sv_newmortal() and sv_setpvn().

13 years agodon't rely on ghost contexts being unmolested
Zefram [Sun, 24 Oct 2010 13:57:21 +0000 (14:57 +0100)]
don't rely on ghost contexts being unmolested

Dying and returning from a format both relied on the state of a
just-popped context frame being preserved across a LEAVE.  Don't rely
on it.  Test using an operator ripped off from Scope::Cleanup, which makes
it easy to run arbitrary Perl code during cleanup, without isolating it
on a separate context stack as the DESTROY mechanism does.

13 years agoMath::BigRat has blead as its upstream
Florian Ragwitz [Sun, 24 Oct 2010 00:18:25 +0000 (17:18 -0700)]
Math::BigRat has blead as its upstream

13 years agoMake mro_package_moved use a mortal in case mro_isa_changed_in3 croaks
Father Chrysostomos [Sun, 24 Oct 2010 17:42:33 +0000 (10:42 -0700)]
Make mro_package_moved use a mortal in case mro_isa_changed_in3 croaks

13 years agoFix SV leak in Perl_emulate_cop_io(), present since 8b850bd54aa90bd3.
Nicholas Clark [Sun, 24 Oct 2010 16:23:17 +0000 (17:23 +0100)]
Fix SV leak in Perl_emulate_cop_io(), present since 8b850bd54aa90bd3.

13 years agoIn B.xs, tidy up make_*_object().
Nicholas Clark [Sun, 24 Oct 2010 16:02:25 +0000 (17:02 +0100)]
In B.xs, tidy up make_*_object().

All callers to make_temp_object, make_warnings_object and make_cop_io_object
pass in a new mortal, so remove the first argument from all 3 and generate the
mortal within them.

Allow a NULL first argument for make_sv_object - generate a new mortal in this
case.

Ideally we'd remove its first argument too, but currently the output typemap
causes code to be generated that first assigns a new mortal to ST(0), then
passes that to make_sv_object(), and it's not obvious how to trivially fix
that.

13 years agoB::hash() should only work on byte sequences.
Nicholas Clark [Sun, 24 Oct 2010 15:00:23 +0000 (17:00 +0200)]
B::hash() should only work on byte sequences.

13 years agoRefactor B::hash to use Perl_newSVpvf() instead of my_sprintf() and new_SVpvn*.
Nicholas Clark [Sun, 24 Oct 2010 14:23:05 +0000 (16:23 +0200)]
Refactor B::hash to use Perl_newSVpvf() instead of my_sprintf() and new_SVpvn*.

13 years agoMore tests for B::hash().
Nicholas Clark [Sun, 24 Oct 2010 14:05:55 +0000 (16:05 +0200)]
More tests for B::hash().

13 years agoB::cchar can be implemented as an ALIAS of B::cstring.
Nicholas Clark [Sun, 24 Oct 2010 13:51:05 +0000 (15:51 +0200)]
B::cchar can be implemented as an ALIAS of B::cstring.

13 years agoRefactor B::cchar() to create a temporary directly, and use Perl_sv_catpvf().
Nicholas Clark [Sun, 24 Oct 2010 12:23:43 +0000 (14:23 +0200)]
Refactor B::cchar() to create a temporary directly, and use Perl_sv_catpvf().

13 years agoTests for B::cchar().
Nicholas Clark [Sun, 24 Oct 2010 12:07:26 +0000 (14:07 +0200)]
Tests for B::cchar().

13 years agoIn B.xs, refactor cstring() to return a mortal, which simplifies the XS code.
Nicholas Clark [Sun, 24 Oct 2010 11:50:52 +0000 (13:50 +0200)]
In B.xs, refactor cstring() to return a mortal, which simplifies the XS code.

13 years agoTest NUL bytes with B::cstring() and B::perlstring().
Nicholas Clark [Sun, 24 Oct 2010 11:49:12 +0000 (13:49 +0200)]
Test NUL bytes with B::cstring() and B::perlstring().

13 years agoB::perlstring can be implemented as an ALIAS of B::cstring.
Nicholas Clark [Sun, 24 Oct 2010 11:35:06 +0000 (13:35 +0200)]
B::perlstring can be implemented as an ALIAS of B::cstring.

13 years agoIn cstring() in B.xs, use Perl_sv_catpvf(), instead of a temporary buffer.
Nicholas Clark [Sun, 24 Oct 2010 10:26:43 +0000 (12:26 +0200)]
In cstring() in B.xs, use Perl_sv_catpvf(), instead of a temporary buffer.

13 years agoMore comprehensive tests for B::cstring() and B::perlstring().
Nicholas Clark [Sun, 24 Oct 2010 10:13:23 +0000 (12:13 +0200)]
More comprehensive tests for B::cstring() and B::perlstring().

13 years agoIn pp_getlogin, use sv_setpv_mg() to avoid needing an explicit strlen() call.
Nicholas Clark [Sun, 24 Oct 2010 08:59:08 +0000 (09:59 +0100)]
In pp_getlogin, use sv_setpv_mg() to avoid needing an explicit strlen() call.

It was using PUSHp() here, meaning local object code for a call to strlen(),
and for SvSETMAGIC().

13 years agopermit labels to appear before declarations
Zefram [Sat, 16 Oct 2010 21:22:57 +0000 (22:22 +0100)]
permit labels to appear before declarations

Include <label> in productions before <decl> and <package_block>.  This
means that labels can now appear at the beginning of all statement-like
things.  There was no technical reason for the restriction of labels
to substantive statements, and that restriction in any case couldn't be
applied to PLUGSTMT-based plugged-in declarations.

13 years agoPerl_hv_name_add needs to set xhv_name_count in one other place.
Father Chrysostomos [Sun, 24 Oct 2010 01:55:29 +0000 (18:55 -0700)]
Perl_hv_name_add needs to set xhv_name_count in one other place.

Perl_hv_name_add was not setting the name count when upgrading a HEK*
to an array of HEK*s.

13 years ago.gitignore some extra ext/B build products
Tony Cook [Sun, 24 Oct 2010 00:37:25 +0000 (11:37 +1100)]
.gitignore some extra ext/B build products

13 years agoremove ; so the conditional actually controls some code
Tony Cook [Sun, 24 Oct 2010 00:35:02 +0000 (11:35 +1100)]
remove ; so the conditional actually controls some code

13 years agomake the definition of sv_catpv_flags match the declaration
Tony Cook [Sun, 24 Oct 2010 00:26:50 +0000 (11:26 +1100)]
make the definition of sv_catpv_flags match the declaration

This was warning on Win32

13 years agosv_setsv_flags was also using a potentially freed HV
Father Chrysostomos [Sun, 24 Oct 2010 00:04:42 +0000 (17:04 -0700)]
sv_setsv_flags was also using a potentially freed HV

13 years agoTels doesn't want to maintain math stuff anymore
Florian Ragwitz [Sat, 23 Oct 2010 22:50:46 +0000 (15:50 -0700)]
Tels doesn't want to maintain math stuff anymore

13 years agoConvert B to use ExtUtils::Constant::ProxySubs for its constants.
Nicholas Clark [Sat, 23 Oct 2010 18:26:53 +0000 (19:26 +0100)]
Convert B to use ExtUtils::Constant::ProxySubs for its constants.

Previously it was using a Perl script to generate C code with pairs of
 newCONSTSUB(stash,"Foo_BAR",newSViv(Foo_BAR));
 av_push(export_ok,newSVpvn("Foo_BAR",7));
for each constant it exported from C to Perl.

Now it uses a loop to process a table. Object code is size reduced by about 42K
on this system (almost 20%)

13 years agoFor PROXYSUBS, add an option to push all constants' names onto an array.
Nicholas Clark [Sat, 23 Oct 2010 18:00:49 +0000 (19:00 +0100)]
For PROXYSUBS, add an option to push all constants' names onto an array.

Typically this would be 'EXPORT_OK', to add all constants to the @EXPORT_OK
array for this package.

13 years agoFor PROXYSUBS, allow an explicit XS_SUBNAME of undef to suppress its generation.
Nicholas Clark [Sat, 23 Oct 2010 17:41:04 +0000 (18:41 +0100)]
For PROXYSUBS, allow an explicit XS_SUBNAME of undef to suppress its generation.

13 years agoChange concise.t to use Storable to test stash/src rendering of constant subs.
Nicholas Clark [Sat, 23 Oct 2010 17:06:42 +0000 (18:06 +0100)]
Change concise.t to use Storable to test stash/src rendering of constant subs.

This allows B to be refactored to change the implementation of its constants.
Storable strives to main compatibility with 5.004 (or so), so unlikely to be
refactored soon.

13 years agoS_glob_assign_glob was using a potentially freed HV
Father Chrysostomos [Sat, 23 Oct 2010 16:48:31 +0000 (09:48 -0700)]
S_glob_assign_glob was using a potentially freed HV