Permalink
Switch branches/tags
Commits on Apr 11, 2011
  1. Require IO::File in IO::Handle

    dgl committed with Father Chrysostomos Apr 8, 2011
    Since 15e6cdd IO::File has been loaded automatically. However this
    automatic loading would not happen in all cases if IO::Handle was
    loaded previously. This is due to the @ISA for IO::File being
    initialised by the core (see the discussion in [perl #87940]).
    
    By ensuring IO::File is loaded if IO::Handle is the indeterminate
    state cannot occur.
Commits on Apr 10, 2011
  1. PATCH: partial [perl #86972]: Allow /(?aia)/

    Karl Williamson committed Apr 10, 2011
    This allows a second regex 'a' modifier in the infix form to not have to
    be contiguous with the first, and improves the message if there are extra
    modifiers.
  2. PATCH: partial [perl #86972]: Allow /aia

    Karl Williamson committed Apr 10, 2011
    This allows a second /a modifier to not have to be contiguous with the
    first.  This patch changes only the part in toke.c where the modifiers
    are in suffix form.
Commits on Apr 9, 2011
  1. PATCH: [perl #87812] BBC breaks Pod::Coverage::TrustPod

    Karl Williamson committed Apr 9, 2011
    This patch completes the fixing of this problem.  The problem is that
    the failing .t set @INC to exclude lib, and hence couldn't find utf8.pm,
    which 5.14 was requiring in places where it previously didn't.  This
    patch finishes the job of not requiring utf8.pm in so many places as
    were inadvertently added in 5.14.  Commit
    3ad9878 started the job.
    
    This patch changes regcomp.c to not set ANYOF_NONBITMAP_NON_UTF8 where
    it inappropriately was.  I don't know what I was thinking when I
    originally did what this changes.  In order to match outside the bitmap,
    these characters all must match something that requires utf8, such as a
    LIGATURE FI.
  2. regcomp.c: Shun ANYOF_NONBITMAP_NON_UTF8

    Karl Williamson committed Apr 9, 2011
    As noted in the comments in the code for this commit, this flag has
    higher consequences than others when it is inappropriately set in the
    synthetic start class.  This patch causes it to not be set unless there
    is some path in the regex engine that needs it, but once set it is never
    cleared.  This results in a different set of false positives than
    currently, but the current set can have this set even if there is no
    path in the engine that needs it.
  3. perldelta: Move the XIDStart change from bugs to incompat.

    Father Chrysostomos committed Apr 9, 2011
    and reword it.
    
    This is probably not the best wording. If someone else is actually
    reading this, please feel free to improve it.
  4. perldelta for [perl #87708]

    Father Chrysostomos committed Apr 9, 2011
    In fixing the regression that #87708 represents, I could not avoid
    also fixing this swapped-operand bug, so it needs a perldelta entry.
    
    I also fixed a tiny formatting error.
Commits on Apr 8, 2011
  1. Revert parts of c31c291..96b6b87

    Father Chrysostomos committed Apr 8, 2011
    This restores the old definition of dPOPTOPiirl_nomg from
    before 96b6b87 and the old definition of dPOPXiirl_ul_nomg from
    before e62ca0f (except for a bug fix: POPi cannot be used since
    it’s magical). It also reverts most of c31c291.
    
    This does mean that uninitialized warnings for various operators are
    back in reverse order. So I am reinstating a bug with this commit. But
    that bug was never a 5.14 blocker and so should never have been fixed
    during code freeze (and there is the slight possibility that the fix
    would break sensitive test suites). It was only fixed ‘for free’ as a
    side effect of fixing [perl #87708], but that bug turned out to have a
    better fix (commit 75ea7a1) that allows these changes to be reverted.
  2. Revert "[perl #87708] $tied / $tied under use integer"

    Father Chrysostomos committed Apr 8, 2011
    This reverts most of commit 76422f8.
    
    It is now unnecessary as of commit 75ea7a1.
  3. Remove unnecessary code from pp_add

    Father Chrysostomos committed Apr 8, 2011
    This code, added recently in 4c3ac4b and amended in 837c879, has been
    unnecessary since commit 75ea7a1.
  4. Remove unnecessary code from pp_eq

    Father Chrysostomos committed Apr 8, 2011
    This code, added recently in 7d779b2, has been unnecessary since com-
    mit 75ea7a1.
  5. Correct the skip count in stash.t

    Father Chrysostomos committed Apr 8, 2011
    This has been wrong since 57f45d7.
  6. [perl #87708] Fix ‘$tied binop $tied’

    Father Chrysostomos committed Apr 8, 2011
    The short story: In 5.13.1 or .2 these ops started calling get-magic
    just once if the same gmagical scalar was used for both operands. Then
    the same value would be used on both sides. In 5.12 FETCH would be
    called twice with both return values used, but they would be swapped
    in most cases (so $t/$t would return 1.5 if $t returned 2 and then
    3). Now FETCH is called twice and the two operands are used in the
    right order.
    
    Up till now there have been patches to fix specific ops, but I real-
    ised that the same ten or so lines of code would have to be added to
    the rest of the 20+ pp_ functions, all of which use tryAMAGICbin_MG
    (which calls Perl_try_amagic_bin in gv.c), so it made sense to add the
    code to Perl_try_amagic_bin instead. This fixes all the ops in one
    fell swoop.
    
    The code in question checks whether the left and right operands are
    the same gmagical scalar. If so, it copies the scalar into a new mor-
    tal one, and then calls get-magic on the original operand to get its
    new value (for the rhs). The new scalar is placed just below the top
    of the stack, so it becomes the left operand.
    
    This does slow down the bitwise integer ops slightly, but only in this
    rare edge case. And the simplification of the code seems worth it.
    
    Forthcoming are commits that revert some of the changes already made,
    as this commit renders them unnecessary.
Commits on Apr 7, 2011
  1. [perl #87708] $tied == $tied

    Father Chrysostomos committed Apr 7, 2011
    This is only part of #87708.
    
    This fixes the + operator outside of any ‘use integer’ scope when the
    same tied scalar is used for both operands and returns two different
    values. Before this commit, get-magic would be called only once and
    the same value used. In 5.12.x it just worked.
    
    I tried modifying pp_eq throughout to take this case into account,
    but it made the most common cases slightly slower, presumably because
    of the extra checks. So this follows the same temp sv method that I
    used for pp_add (in 4c3ac4b and 837c879), which, though slowing down
    this edge cases due to the extra allocation, leaves the most common
    cases just as fast. (And, in case my benchmarks were unreliably [not
    unlikely], this method is also safer, as it has less chance of getting
    different code paths wrong.)
  2. Make :utf8 and :bytes MULTIARG

    Leont committed with Father Chrysostomos Apr 7, 2011
    PerlIO layer types have this property that flags if they can accept
    multiple arguments or only one. Unfortunately, this always checks the
    uppermost layer that has an Open method defined. This causes issues when
    used with utf8 or bytes on top of a layer that uses multiple arguments.
    
    For 5.15 I think abolishing this feature may make most sense. It's just
    flat out wrong IMO, it's the layer that uses the arguments that should
    validate them, not the topmost, which may not even touch them. In the
    mean time adding the multiargs flag to :utf8 and :bytes is a reasonable
    stop-gap.
    
    This patch makes perl slightly more permissive, so it shouldn't break
    any working code out there.
  3. PATCH: [perl #87810] BBC Text::MultiMarkdown

    Karl Williamson committed Apr 7, 2011
    A statement should have been outside a block but was inside it.
    The indentation was correct, and in a number of times reading
    the code I still missed it.
    
    I'm having trouble distilling down the failure scenario into
    a simple test case, and am short on tuits right now, so a test
    will be committed later.
  4. [perl #87388] bless[], "main::" crashes

    Father Chrysostomos committed Apr 7, 2011
    As mention in the ticket, this was caused by b4dd662, which removed
    ‘dead’ code from gv_stashpvn:
    
    commit b4dd662
    Author: Nicholas Clark <nick@ccl4.org>
    Date:   Fri Oct 8 21:33:29 2010 +0100
    
        Remove dead code from Perl_gv_stashpvn().
    
        GvHV() and HvNAME() will both always already be set, as gv_fetchpvn_flags()
        will initialise these as it walks the string in its initial loop to locate the
        correct stash, then return early because name == name_end.
    
        This code has been dead since it was added in 5.000.
    
    --- a/gv.c
    +++ b/gv.c
    @@ -927,11 +927,9 @@ Perl_gv_stashpvn(pTHX_ const char *name, U32 namelen, I32 flags)
     	Safefree(tmpbuf);
         if (!tmpgv)
     	return NULL;
    -    if (!GvHV(tmpgv))
    -	GvHV(tmpgv) = newHV();
         stash = GvHV(tmpgv);
    -    if (!HvNAME_get(stash))
    -	hv_name_set(stash, name, namelen, 0);
    +    assert(stash);
    +    assert(HvNAME_get(stash));
         return stash;
     }
    
    This routine, before the snippet shown, adds two colons to the end of
    the name and then passes "main::::" to gv_fetch_pvn_flags.
    
    gv_fetch_pvn_flags, when it parses a "::", sets the next subname to
    point to the character after the second colon, and then continues
    scanning from the next character *after* that. So foo::::bar becomes
    $foo::{"::bar"} and main:::: becomes $main::{"::"}.
    
    The code that assigns the name to the stash and the early exit are
    both inside an if(we have a package separator) block, but the final ::
    is not considered one, so a nameless hash is returned.
    
    The easiest way to fix this is to revert just the changes to
    lines that deal with the name (since the other deleted lines are
    really dead).
  5. Correct stupidities in 4c3ac4b

    Father Chrysostomos committed Apr 7, 2011
    Allocating an extra SV for rare edge cases...er...only needs to be
    done in those rare edge cases.
    
    Uninitialized warnings are only supposed to be enabled when they are.
  6. [perl #87708] $tied + $tied

    Father Chrysostomos committed Apr 7, 2011
    This is just part of #87708.
    
    This fixes the + operator outside of any ‘use integer’ when the same
    tied scalar is used for both operands and returns two different val-
    ues. Before this commit, get-magic would be called only once and the
    same value used. In 5.12.x it worked.
Commits on Apr 6, 2011
  1. make mg_clear() et al behave when RC==0

    iabyn committed Apr 6, 2011
    The functions S_save_magic() and S_restore_magic(), which are called by
    mg_get(), mg_set(), mg_length(), mg_size() and mg_clear(),
    are not robust when called with an SV whose reference count is zero.
    Basically, one of the actions of S_save_magic() is to temporarily
    increase the refcount of the SV, and then for S_restore_magic() to reduce
    it again at the end, so that if any of the magic functions called
    inbetween decrease the count, it won't be prematurely freed.
    However, if the count starts at zero, then bumping it up and bringing it
    back down to zero, triggers a spurious second freeing.
    
    So, if its zero, just skip the whole bumping thing.
    
    Now, we shouldn't really be calling these functions will a zero-refcount
    SV, but these things happen, and its best to be robust.
    
    In particular, this fixes RT #87860, which was ultimately triggered by a
    bug in Set::Object 1.28 that managed to create an HV with null SvMAGIC
    field, but with the RMG flag set.
    
    When freeing that HV, sv_clear() skips doing mg_free() because SvMAGIC is
    null, whereas later it calls Perl_hv_undef_flags, which calls mg_clear()
    because it uses the test SvRMAGICAL(hv) (which is true).
  2. [perl #87708] $tied / $tied under use integer

    Father Chrysostomos committed Apr 6, 2011
    This is just part of #87708.
    
    This fixes the / operator under ‘use integer’ when the same tied sca-
    lar is used for both operands and returns two different values. Before
    this commit, get-magic would be called only once and the same value
    used. In 5.12.x the operands were swapped.
  3. [perl #87708] $tied % $tied and $tied * $tied under use integer

    Father Chrysostomos committed Apr 6, 2011
    This is just part of #87708.
    
    This fixes the % and * operators under ‘use integer’ when the same
    tied scalar is used for both operands and returns two different val-
    ues. Before this commit, get-magic would be called only once and
    the same value used. In 5.12.x * just worked but the operands were
    swapped for %.
    
    It turns out that every operator using the dPOPTOPiirl_nomg macro
    needs exactly the same treatment, so this commit eliminates the
    dPOPTOPiirl_halfmg macro added a few commits ago and modifies
    dPOPTOPiirl_nomg to do was it was doing. This should be perfectly
    safe, as dPOPTOPiirl_nomg has not been in a stable release (and is
    only for internal use anyway).
  4. [perl #87708] $tied + $tied and $tied - $tied under ‘use integer’

    Father Chrysostomos committed Apr 6, 2011
    This is just part of #87708.
    
    This fixes + and - under ‘use integer’ when the same tied scalar is
    used for both operands and returns two different values. Before this
    commit, get-magic would be called only once and the same value used.
    In 5.12.x + just worked but the operands were swapped for -.
  5. [perl #87708] use integer; $tied < $tied

    Father Chrysostomos committed Apr 6, 2011
    This is just part of #87708.
    
    This fixes < under ‘use integer’ when the same tied scalar is used for
    both operands and returns two different values. Before this commit,
    get-magic would be called only once and the same value used. In 5.12.x
    the operands were swapped.
  6. [perl #87708] use integer; $tied > $tied

    Father Chrysostomos committed Apr 6, 2011
    This is just part of #87708.
    
    This fixes > under ‘use integer’ when the same tied scalar is used for
    both operands and returns two different values. Before this commit,
    get-magic would be called only once and the same value used. In 5.12.x
    the operands were swapped.
  7. [perl #87708] use integer; $tied <= $tied

    Father Chrysostomos committed Apr 6, 2011
    This is just part of #87708.
    
    This fixes <= under ‘use integer’ when the same tied scalar is used
    for both operands and returns two different values. Before this com-
    mit, get-magic would be called only once and the same value used. In
    5.12.x the operands were swapped.
  8. [perl #87708] use integer; $tied >= $tied

    Father Chrysostomos committed Apr 6, 2011
    This is just part of #87708.
    
    This fixes >= under ‘use integer’ when the same tied scalar is used
    for both operands and returns two different values. Before this com-
    mit, get-magic would be called only once and the same value used. In
    5.12.x the operands were swapped.
  9. [perl #87708] use integer; $tied == $tied

    Father Chrysostomos committed Apr 6, 2011
    This is just part of #87708.
    
    This fixes == under ‘use integer’ when the same tied scalar is used
    for both operands and returns two different values. Before this com-
    mit, get-magic would be called only once and the same value used. In
    5.12.x it just worked.
  10. [perl #87708] use integer; $tied != $tied

    Father Chrysostomos committed Apr 6, 2011
    This is just part of #87708.
    
    This fixes != under ‘use integer’ when the same tied scalar is used
    for both operands and returns two different values. Before this com-
    mit, get-magic would be called only once and the same value used. In
    5.12.x it just worked.
  11. PATCH: [perl #87908] \W is its complement sometimes

    Karl Williamson committed Apr 6, 2011
    A missing '!' turned \W into \w in some code execution paths and utf8 data.
    This patch fixes that.
    
    It does not include tests at the moment, since I don't have time
    just now to examine why the existing tests didn't catch this, when
    it looks like they are set up to, and there have been several BBC tickets
    lately that I'm hopeful this may fix and head off other ones.
  12. [perl #87708] use integer; $tied <=> $tied

    Father Chrysostomos committed Apr 6, 2011
    This is just part of #87708.
    
    This fixes <=> under ‘use integer’ when the same tied scalar is used
    for both operands and returns two different values. Before this com-
    mit, get-magic would be called only once and the same value used. In
    5.12.x, the operands would be reversed.
  13. c31c291 swaps the order of uninitialised warnings, so update test exp…

    Nicholas Clark committed Apr 6, 2011
    …ectations
  14. [perl #87708] atan2 $tied, $tied

    Father Chrysostomos committed Apr 6, 2011
    This fixes atan2 when the same tied scalar is used for both operands
    and returns two different values. Before this commit, get-magic would
    be called only once and the same value used. In 5.12.x, the operands
    would be reversed.
  15. PATCH: [perl #87726] unwanted warning from diagnostics.pm under -w

    Karl Williamson committed Apr 5, 2011
    It turns out to be an extra semicolon
Commits on Apr 5, 2011
  1. Er, 87708, not 87726

    Father Chrysostomos committed Apr 5, 2011