Permalink
Switch branches/tags
Commits on Dec 31, 2010
  1. codegeneration step

    committed Nov 17, 2009
Commits on Dec 30, 2010
  1. Add "while" tests

    committed Dec 16, 2010
  2. clone with stack XS-APItest

    committed Nov 6, 2010
  3. Better handling of magic methods freeing the SV

    This is a fix for RT #81230 (and more). Currently, mg_get() works around
    the case where the called magic (e.g. FETCH) frees the magic SV. It does
    this by unconditionally pushing the SV on the tmps stack before invoking
    the method.
    
    There are two issues with this. Firstly, it may artificially extend the
    life of the SV. This was the root of the problem with #81230. There, the
    DB_File code, under -T, created a tainted tied object. Accessing the
    object (within FETCH as it happens), caused mg_get() to be invoked on the
    object (due to the taint magic), and thus extend the life of the object.
    This then caused c<untie %h if $h{k}> to give the warning
        untie attempted while 1 inner references still exist.
    This only became noticeable after efaf367,
    which stopped wrapping magic method calls in SAVETMPS/FREETMPS.
    
    The second issue issue that this protection only applies to mg_get();
    functions like mg_set() can still segfault if the SV is deleted.
    
    This commit fixes both problems as follows:
    
    First, the protection mechanism is moved out of mg_get() and into
    save_magic() / restore_magic(), so that it protects more things.
    Secondly, the protection is now:
    
    * in save_magic(), SvREFCNT_inc() the SV, thus protecting it from being
      freed during FETCH (or whatever)
    
    * in restore_magic(), SvREFCNT_dec() the SV, undoing the protection
      without extending the life of the SV, *except* if the refcount is
      1 (ie FETCH tried to free it), then push it on the mortals stack
      to extend it life a bit so our callers wont choke on it.
    iabyn committed Dec 30, 2010
Commits on Dec 29, 2010
  1. Update Renee Baeckers mail address

    Signed-off-by: David Golden <dagolden@cpan.org>
    Renee Baecker committed with xdg Dec 29, 2010
Commits on Dec 28, 2010
  1. close the produced test file so win32 can unlink it

    Previously runs would leave a GLOB(0x...) file in t/
    tonycoz committed Dec 28, 2010
  2. As report_evil_fh() checks WARN_{CLOSED,UNOPENED}, don't duplicate this.

    This trades reduced code size for an extra function call in the error path with
    warnings disabled. (And removes a duplicated check for the case of taking the
    error path *with* warnings enabled.)
    
    Removing the check from Perl_do_close() does not change behaviour, as io is
    NULL there, hence Perl_report_evil_fh() will always be checking WARN_UNOPENED
    and setting vile to "unopened".
    Nicholas Clark committed Dec 28, 2010
  3. As report_wrongway_fh() checks ckWARN(WARN_IO) internally, don't dupl…

    …icate this.
    
    This trades reduced code size for an extra function call in the error path with
    warnings disabled. (And removes a duplicated check for the case of taking the
    error path *with* warnings enabled.)
    Nicholas Clark committed Dec 28, 2010
  4. Remove OP_phoney_{IN,OUT}PUT_ONLY, as they are no longer used or supp…

    …orted.
    Nicholas Clark committed Dec 28, 2010
  5. Argument op to report_evil_fh() is always PL_op->op_type, so need not…

    … be passed
    Nicholas Clark committed Dec 28, 2010
  6. The io argument to report_evil_fh() is always GvIO(gv), so need not b…

    …e passed.
    Nicholas Clark committed Dec 28, 2010
  7. Extract the OP_phoney_* code from report_evil_fh() into report_wrongw…

    …ay_fh()
    
    Previously Perl_report_evil_fh()'s body was just an if/else at the top level -
    a good sign that it is actually implementing two disjoint functions.
    Nicholas Clark committed Dec 28, 2010
  8. In pp_sockpair, remove duplication of code to close the supplied file…

    … handles.
    
    It's not necessary to (also) test gv1 and gv2 before returning undef as an
    error, because io1 will automatically be NULL if gv1 is NULL, and similarly
    io2 if gv2 is.
    Nicholas Clark committed Dec 28, 2010
  9. Fix typo in warning code added to pp_sockpair in c289d2f.

    That should be gv2, not gv1. However, I believe that it's impossible to reach
    the warning code, given the structure of the optree that the perl 5
    implementation produces, as gv1 and gv2 will never be NULL, and GvIOn() will
    always return non-NULL. (Or croak, but that won't return).
    Nicholas Clark committed Dec 28, 2010
  10. avoid undefined behaviour in fetch and modify of SP from 0a0e3cc

    pp_sys.c: In function ‘Perl_pp_send’:
    pp_sys.c:1845: warning: operation on ‘sp’ may be undefined
    tonycoz committed Dec 28, 2010
Commits on Dec 27, 2010
  1. Simplify return handling for tied handle OPEN/PRINTF/READ/WRITE.

    Their code used to explicitly move the return value from its current position
    on the stack, to the position that was top of top of the stack just before the
    call was made. However, the POPBLOCK() in pp_leavesub will restore the stack
    pointer, and passing G_SCALAR to call_method() will force exactly one return
    value, so all of this is needless defensiveness.
    Nicholas Clark committed Dec 27, 2010
  2. A perldelta entry describing the refactoring of the chop/chomp implem…

    …entation.
    Nicholas Clark committed Dec 27, 2010
  3. Move do_chomp() from pp.c to doop.c, and make it static.

    It was never part of the public API, and only ever used by pp_{s,}cho{,m}p.
    Nicholas Clark committed Dec 27, 2010
  4. Merge the opcode bodies for chop/chomp and schop/schomp.

    Nicholas Clark committed Dec 27, 2010
  5. Merge Perl_do_chop() and Perl_do_chomp().

    They share code for dealing with PVAVs, PVHVs, read only values and handling
    PL_encoding. They are not part of the public API, and Google codesearch shows
    no users outside the core.
    Nicholas Clark committed Dec 27, 2010
  6. Convert Perl_do_chomp() to the same prototype as Perl_do_chop().

    Pass in an SV to hold the count, rather than returning the count.
    Nicholas Clark committed Dec 27, 2010
  7. Refactor pp_chomp to process arguments in the same order as pp_chop.

    Previously list chomp worked from last to first, whilst list chop worked from
    first to last.
    Nicholas Clark committed Dec 27, 2010