Commits on Mar 28, 2013
  1. Remove the non-inline function S_croak_memory_wrap from inline.h.

    This appears to resolve these three related tickets:
        [perl #116989] S_croak_memory_wrap breaks gcc warning flags detection
        [perl #117319] Can't include perl.h without linking to libperl
        [perl #117331] Time::HiRes::clock_gettime not implemented on Linux (regression?)
    This patch changes S_croak_memory_wrap from a static (but not inline)
    function into an ordinary exported function Perl_croak_memory_wrap.
    This has the advantage of allowing programs (particuarly probes, such
    as in cflags.SH and Time::HiRes) to include perl.h without linking
    against libperl.  Since it is not a static function defined within each
    compilation unit, the optimizer can no longer remove it when it's not
    needed or inline it as needed.  This likely negates some of the savings
    that motivated the original commit 380f764c1ead36fe3602184804292711.
    However, calling the simpler function Perl_croak_memory_wrap() still
    does take less set-up than the previous version, so it may still be a
    slight win.  Specific cross-platform measurements are welcome.
    Andy Dougherty committed Mar 27, 2013
  2. shouldn't prepend Perl_ to symbols already starting with P…

    In the next patch, I have Perl_croak_memory_wrap defined in embed.fnc with
    the 'nroX' flags, since this is a private function used by public macros.
    I used the long form of the name Perl_croak_memory_wrap everywhere, and
    used the 'o' flag so that embed.h wouldn't contain a useless #define
    croak_memory_wrap Perl_croak_memory_wrap.  Unfortunately,
    (used by the Win32 build process) didn't know what to do with that entry
    and created an entry Perl_Perl_croak_memory_wrap.   Changing
    to use the 'o' flag to decide whether to add the Perl_ prefix resulted
    in over 50 other symbols changing in the output of  I don't
    know if the changes are correct or if the 'o' flag is in error on those
    entries in embed.fnc, but I don't have time to check them all out.
    This patch just stops from adding a Perl_ prefix if there is
    already one there.
    Andy Dougherty committed Mar 28, 2013
Commits on Mar 27, 2013
  1. eliminate the only internal uses of HvFILL

    The usages are as far as I know incorrect anyway. We resize
    the hash bucket array based on the number of keys it holds,
    not based on the number of buckets that are used, so this
    usage was wrong anyway.
    Another bug that this revealed is that the old code would allow
    HvMAX(hv) to fall to 0, even though every other part of the
    core expects it to have a minimum of 7 (meaning 8 buckets).
    As part of this we change the hard coded 7 to a defined constant
    After this patch there remains one use of HvFILL in core, that used
    for scalar(%hash) which I plan to remove in a later patch.
    demerphq committed Mar 27, 2013
  2. prevent SEGV from buffer read overrun, and refactor away duplicated code

    The split patch introduced a buffer read overrun error in sv_dump() when
    stringifying empty strings. This bug was always existant but was probably
    never triggered because we almost always have at least one extflags set,
    so it never got an empty buffer to show. Not so with the new compflags. :-(
    demerphq committed Mar 27, 2013
  3. fix comment, reindent and add parenthesis for clarity

    I had to stare at this expression and make sure there wasn't
    anything tricky for too long, so I added parens, and reindented
    demerphq committed Mar 25, 2013
  4. rework split() special case interaction with regex engine

    This patch resolves several issues at once. The parts are
    sufficiently interconnected that it is hard to break it down
    into smaller commits. The tickets open for these issues are:
      RT #94490  - split and constant folding
      RT #116086 - split "\x20" doesn't work as documented
    It additionally corrects some issues with cached regexes that
    were exposed by the split changes (and applied to them).
    It effectively reverts 5255171
    and cccd142.
    Prior to this patch the special RXf_SKIPWHITE behavior of
        split(" ", $thing)
    was only available if Perl could resolve the first argument to
    split at compile time, meaning under various arcane situations.
    This manifested as oddities like
        my $delim = $cond ? " " : qr/\s+/;
        split $delim, $string;
        split $cond ? " ", qr/\s+/, $string
    not behaving the same as:
        ($cond ? split(" ", $string) : split(/\s+/, $string))
    which isn't very convenient.
    This patch changes this by adding a new flag to the op_pmflags,
    PMf_SPLIT which enables pp_regcomp() to know whether it was called
    as part of split, which allows the RXf_SPLIT to be passed into run
    time regex compilation. We also preserve the original flags so
    pattern caching works properly, by adding a new property to the
    regexp structure, "compflags", and related macros for accessing it.
    We preserve the original flags passed into the compilation process,
    so we can compare when we are trying to decide if we need to
    Note that this essentially the opposite fix from the one applied
    originally to fix #94490 in 5255171.
    The reverted patch was meant to make:
            split( 0 || " ", $thing )            #1
    consistent with
            my $x=0; split( $x || " ", $thing )  #2
    and not with
            split( " ", $thing )                 #3
    This was reverted because it broke C<split("\x{20}", $thing)>, and
    because one might argue that is not that #1 does the wrong thing,
    but rather that the behavior of #2 that is wrong. In other words
    we might expect that all three should behave the same as #3, and
    that instead of "fixing" the behavior of #1 to be like #2, we should
    really fix the behavior of #2 to behave like #3. (Which is what we did.)
    Also, it doesn't make sense to move the special case detection logic
    further from the regex engine. We really want the regex engine to decide
    this stuff itself, otherwise split " ", ... wouldn't work properly with
    an alternate engine. (Imagine we add a special regexp meta pattern that behaves
    the same as " " does in a split /.../. For instance we might make
    split /(*SPLITWHITE)/ trigger the same behavior as split " ".
    The other major change as result of this patch is it effectively
    reverts commit cccd142, which
    was intended to get rid of RXf_SPLIT and RXf_SKIPWHITE, which
    and free up bits in the regex flags structure.
    But we dont want to get rid of these vars, and it turns out that
    RXf_SEEN_LOOKBEHIND is used only in the same situation as the new
    RXf_NO_INPLACE_SUBST, and then instead of using two vars we use
    only the one. Which in turn allows RXf_SPLIT and RXf_SKIPWHITE to
    have their bits back.
    demerphq committed Mar 25, 2013
  5. simplify regcomp.c by using vars to avoid repeated macros

    Use two temporary variables to simplify the logic, and maybe
    speed up a nanosecond or two.
    Also chainsaw some long dead logic. (I #ifdef'ed it out years ago)
    demerphq committed Mar 25, 2013
  6. Improve how handles multibits

    In preparation for future changes.
    demerphq committed Mar 25, 2013
  7. Silence "smartmatch is experimental" warnings in autodie

    Hugmeir committed with Karl Williamson Mar 25, 2013
  8. perldelta for the new warnings

    Hugmeir committed with Karl Williamson Mar 26, 2013
  9. Make smartmatch, given & when experimental

    Hugmeir committed with Karl Williamson Mar 25, 2013
  10. t/porting/dual-life.t: Drop dependency on smartmatch

    Hugmeir committed with Karl Williamson Mar 25, 2013
  11. t/re/regexp_unicode_prop.t: Drop dependency on given/when

    Hugmeir committed with Karl Williamson Mar 23, 2013
  12. Porting/core-cpan-diff: Drop dependency on smartmatch

    Hugmeir committed with Karl Williamson Mar 23, 2013
  13. Porting/ Drop dependency on smartmatch

    Hugmeir committed with Karl Williamson Mar 23, 2013
  14. File::Glob: Drop dependency on given/when

    Hugmeir committed with Karl Williamson Mar 23, 2013
Commits on Mar 26, 2013
  1. perlapi: Document some macros

    Karl Williamson committed Mar 26, 2013
Commits on Mar 25, 2013
  1. xs_init() must pass a static char* when creating &DynaLoader::boot_Dy…

    newXS() assumes that the passed pointer to the filename is in static storage,
    or otherwise will outlive the PVCV that it is about to create, and hence that
    it's safe to copy the pointer, not the value, to CvFILE.  Hence xs_init()
    must not use an auto array to "store" the filename, as that will be on the
    stack, and becomes invalid as soon as xs_init() returns.  The analogous bug
    fix was made in universal.c by commit 157e3fc in Feb 2006.
    Spotted by compiling for ithreads with gcc 4.8.0's ASAN and running
    Nicholas Clark committed Mar 25, 2013
  2. In In S_scan_heredoc(), avoid memNE() reading beyond the end of s.

    If the heredoc terminator we are searching for is longer than the bytes
    remaining in s, then the memNE() would read beyond initialised memory.
    Hence change the loop bounds to avoid this case, and change the failure case
    below to reflect the revised end-of-loop condition.
    It doesn't matter that the loop no longer increments shared->herelines,
    because the failure case calls S_missingterm(), which croaks.
    Nicholas Clark committed Mar 25, 2013
  3. In S_scan_heredoc(), the explicit test for '\n' duplicates the strNE().

    PL_tokenbuf always starts with '\n', so a separate test of *s against '\n'
    is duplicate work. Hence remove it, to make the code simpler and clearer.
    Nicholas Clark committed Mar 25, 2013
  4. PerlIO_find_layer should not be using memEQ() off the end of the laye…

    …r name.
    PerlIO_find_layer was using memEQ() to compare the name of the desired layer
    with each layer in the array of known layers. However, it was always using
    the length of the desired layer for the comparison, whatever the length of
    the name it was comparing it with, resulting in out-of-bounds reads.
    Nicholas Clark committed Mar 25, 2013
  5. Copyright update for vms/vms.c.

    Happy 20th Anniversary, Charles.
    craigberry committed Mar 25, 2013
  6. Make vms.c's Perl_flex_fstat preserve errno on success.

    The CRTL's fstat() sets errno to EVMSERR and vaxc$errno to RMS$_IOP
    when called on a proccess-permanent file (i.e., stdin, stdout, or
    stderr).  That error generally means a rewind operation on a file
    that cannot be rewound.  It's odd that fstat is doing such a thing,
    but we can at least protect ourselves from the effects of it by
    saving errno and restoring it on a successful call.
    This cures a couple of test failures and TODOs in t/io/errno.t.
    craigberry committed Mar 25, 2013
  7. Revert "Restore errno after VMS hack in S_sv_gets_read_record."

    This reverts commit d46f021.
    This can be done more universally (and from the point of view of
    sv.c, less obtrusively) in Perl_flex_fstat in vms/vms.c.
    craigberry committed Mar 25, 2013
Commits on Mar 24, 2013
  1. improve how Devel::Peek::Dump handles iterator information

    * If the hash is not OOK omit any iterator status information
      instead of showing -1/NULL
    * If the hash is OOK then add the RAND value from the iterator
      and if the LASTRAND is not the same show it too
    * Tweak tests to test the above.
    demerphq committed Mar 24, 2013
  2. improve iterator randomization

    demerphq committed Mar 24, 2013
  3. Add epigraph for 5.17.10

    Max Maischein committed Mar 24, 2013
Commits on Mar 23, 2013
  1. fix Peek.t to work with NEW COW

    iabyn committed Mar 23, 2013
  2. Revert "fix Peek.t to work with NEW COW"

    This reverts commit 2b656fc.
    I accidentally included the changes I was reviewing from a patch of
    iabyn committed Mar 23, 2013
  3. regcomp.c: silence compiler warning

    add a cast before doing a printf "%x" on a pointer
    iabyn committed Mar 23, 2013
  4. add descriptions to require.t test output

    This is particularly important as in several places, the ok or not ok
    message is generated in different ways depending on whether a require
    successfully executed and printed "ok" for example.
    iabyn committed Mar 23, 2013
  5. fix Peek.t to work with NEW COW

    iabyn committed Mar 23, 2013