develooper Front page | perl.perl5.porters | Postings from February 2010

Re: [perl #70171] 5.10.0 -> 5.10.1 Regression in fafafbaf70 (Big slowdown in 5.10 @_ parameter passing)

Thread Previous
From:
Ævar Arnfjörð Bjarmason
Date:
February 16, 2010 08:48
Subject:
Re: [perl #70171] 5.10.0 -> 5.10.1 Regression in fafafbaf70 (Big slowdown in 5.10 @_ parameter passing)
Message ID:
51dd1af81002160847q76329fd4o174738bc60212d3c@mail.gmail.com
On Mon, Dec 14, 2009 at 15:31, Rafael Garcia-Suarez <rgs@consttype.org> wrote:
> 2009/12/13 Father Chrysostomos <sprout@cpan.org>:
>>
>> On Dec 7, 2009, at 5:35 AM, Rafael Garcia-Suarez wrote:
>>
>>> 2009/12/6 Father Chrysostomos <sprout@cpan.org>:
>>>>
>>>> In this case my %x = %$x assigns a hash to itself. This causes the
>>>> hv_clear
>>>> in pp_aassign to wipe away the hash before it can be copied. The ‘panic:
>>>> attempt to copy freed scalar’ error is triggered by this line, which
>>>> copies
>>>> the value:
>>>>                       sv_setsv(tmpstr,*relem);        /* value */
>>>>
>>>> The solution is to make sure the OPpASSIGN_COMMON flag is on in such
>>>> cases,
>>>> so that pp_aassign copies everything before doing the assignment.
>>>
>>> Even if you have an OP_PADSV on the left ? I think that in this case
>>> we can leave the optimisation in.
>>
>> The optimisation disabled by OPpASSIGN_COMMON is still enabled for OP_PADSV
>> with this patch, but the maybe_common_vars optimisation is not, so attached
>> is a replacement patch.
>
> Thanks, applied to bleadperl as 0f907b96d618c97cd2e020841a70ae037954a616.

I added one extra test to that for good measure:
http://github.com/avar/perl/commit/26b110cf2c6fe8d8bb6ba625b0905c60392255ee

It can be pulled from the rt-70171-extra-test branch on
git://github.com/avar/perl.git

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About