Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
branch blead, updated. v5.17.5-120-g644ac3a
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
"Father Chrysostomos"  
View profile  
 More options Nov 2 2012, 8:45 am
Newsgroups: perl.perl5.changes
From: spr...@cpan.org ("Father Chrysostomos")
Date: Fri, 02 Nov 2012 13:28:48 +0100
Local: Fri, Nov 2 2012 8:28 am
Subject: [perl.git] branch blead, updated. v5.17.5-120-g644ac3a
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/644ac3a877e810ca7c69833...>

- Log -----------------------------------------------------------------
commit 644ac3a877e810ca7c69833b568049c1c2665ce9
Author: Father Chrysostomos <spr...@cpan.org>
Date:   Thu Nov 1 21:48:22 2012 -0700

    Don’t leak when pushing on to read-only array

    $ ./miniperl -Ilib -w -e 'warn $$; while(1){eval {push @-, ""}}'

    Croak first instead of creating a new element to store in the
    array first and letting av_store croak.
-----------------------------------------------------------------------

Summary of changes:
 pp.c          |    1 +
 t/op/svleak.t |    6 +++++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/pp.c b/pp.c
index d1cac93..a402672 100644
--- a/pp.c
+++ b/pp.c
@@ -5080,6 +5080,7 @@ PP(pp_push)
        SPAGAIN;
     }
     else {
+       if (SvREADONLY(ary) && MARK < SP) Perl_croak_no_modify(aTHX);
        PL_delaymagic = DM_DELAY;
        for (++MARK; MARK <= SP; MARK++) {
            SV *sv;
diff --git a/t/op/svleak.t b/t/op/svleak.t
index a705587..15ffb46 100644
--- a/t/op/svleak.t
+++ b/t/op/svleak.t
@@ -15,7 +15,7 @@ BEGIN {

 use Config;

-plan tests => 42;
+plan tests => 43;

 # run some code N times. If the number of SVs at the end of loop N is
 # greater than (N-1)*delta at the end of loop 1, we've got a leak
@@ -283,6 +283,10 @@ leak(2, 0, sub {
     eval { push @a, $die_on_fetch };
 }, 'pushing exploding scalar does not leak');

+leak(2, 0, sub {
+    eval { push @-, '' };
+}, 'pushing onto read-only array does not leak');
+

 # Run-time regexp code blocks
 {

--
Perl5 Master Repository


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »