In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/dd314e1ca8c35e1e3f33c104a0ebca62c28f2d3e?hp=16a07156bec367e245074eb7448892c5f81feeef>

- Log -----------------------------------------------------------------
commit dd314e1ca8c35e1e3f33c104a0ebca62c28f2d3e
Author: Tony Cook <t...@develop-help.com>
Date:   Tue Feb 7 16:14:53 2017 +1100

    (perl #130722) don't call SvPVX() on a glob
    
    S_doparseform() called SvPVX() on the format argument, which
    produced an assertion failure when the format was supplied as a
    glob.
    
    Since S_doparseform() calls SvPV() initially and stores the result,
    just use that result.
-----------------------------------------------------------------------

Summary of changes:
 pp_ctl.c     | 2 +-
 t/op/write.t | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/pp_ctl.c b/pp_ctl.c
index 0b759035ad..2fcceb2bd2 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -5162,7 +5162,7 @@ S_doparseform(pTHX_ SV *sv)
        SV *old = mg->mg_obj;
        if ( !(!!SvUTF8(old) ^ !!SvUTF8(sv))
              && len == SvCUR(old)
-             && strnEQ(SvPVX(old), SvPVX(sv), len)
+              && strnEQ(SvPVX(old), s, len)
        ) {
            DEBUG_f(PerlIO_printf(Perl_debug_log,"Re-using compiled format\n"));
            return mg;
diff --git a/t/op/write.t b/t/op/write.t
index a36da8ae0c..99f827fe0f 100644
--- a/t/op/write.t
+++ b/t/op/write.t
@@ -98,7 +98,7 @@ for my $tref ( @NumTests ){
 my $bas_tests = 21;
 
 # number of tests in section 3
-my $bug_tests = 66 + 3 * 3 * 5 * 2 * 3 + 2 + 66 + 6 + 2 + 3 + 96 + 11 + 13;
+my $bug_tests = 66 + 3 * 3 * 5 * 2 * 3 + 2 + 66 + 6 + 2 + 3 + 96 + 11 + 14;
 
 # number of tests in section 4
 my $hmb_tests = 37;
@@ -2038,6 +2038,9 @@ EOP
 
 $^A = "";
 
+# [perl #130722] assertion failure
+fresh_perl_is('for(1..2){formline*0}', '', { stderr => 1 } , "#130722 - 
assertion failure");
+
 #############################
 ## Section 4
 ## Add new tests *above* here

--
Perl5 Master Repository

Reply via email to