New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5.10.0 -> 5.10.1 Regression in fafafbaf70 (Big slowdown in 5.10 @_ parameter passing) #9943
Comments
From @avarSee the thread on p5p discussing this bug: When I upgraded from 5.10.0 -> 5.10.1 I discovered a regression in perl -e 'my $x = get_x(); my %x = %$x; sub get_x { %x=(1..1000); On my system it just does that for sufficiently large values of (1 => undef, 3 => undef, 5 => undef, 7 => undef, 9 => undef) While on 5.10.0 it's the correct: (1 => 2, 3 => 4, 5 => 6, 7 => 8, 9 => 10) On other perl versions (asking around in #p5p) the results have been: Here's an overview of what might be wrong: |
From @b2gillsOn Mon, Nov 2, 2009 at 10:52 AM, Ãvar Arnfjörð Bjarmason
What happens when you run perl -Mstrict -we 'my $x = get_x(); my %x = %$x; sub get_x { on those systems? |
The RT System itself - Status changed from 'new' to 'open' |
From @avarOn Tue, Nov 3, 2009 at 4:17 PM, Brad Gilbert <b2gills@gmail.com> wrote:
The exact same thing (although I've only tested under 5.10.1). |
From @cpansproutIn this case my %x = %$x assigns a hash to itself. This causes the The solution is to make sure the OPpASSIGN_COMMON flag is on in such This fix causes a bus error in sort.t, because it happens to expose |
From @cpansproutInline Patchdiff -Nurp blead/op.c bleadcopy/op.c
--- blead/op.c 2009-11-21 10:43:09.000000000 -0800
+++ bleadcopy/op.c 2009-11-27 07:16:44.000000000 -0800
@@ -4266,7 +4266,6 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *le
|| left->op_type == OP_PADHV
|| left->op_type == OP_PADANY))
{
- maybe_common_vars = FALSE;
if (left->op_private & OPpPAD_STATE) {
/* All single variable list context state assignments, hence
state ($a) = ...
diff -Nurp blead/t/op/array.t bleadcopy/t/op/array.t
--- blead/t/op/array.t 2009-11-19 08:51:40.000000000 -0800
+++ bleadcopy/t/op/array.t 2009-11-27 06:32:22.000000000 -0800
@@ -7,7 +7,7 @@ BEGIN {
require 'test.pl';
-plan (125);
+plan (127);
#
# @foo, @bar, and @ary are also used from tie-stdarray after tie-ing them
@@ -428,5 +428,19 @@ sub test_arylen {
is("$x $y $z", "1 1 2");
}
+# [perl #70171]
+{
+ my $x = get_x(); my %x = %$x; sub get_x { %x=(1..4); return \%x };
+ is(
+ join(" ", map +($_,$x{$_}), sort keys %x), "1 2 3 4",
+ 'bug 70171 (self-assignment via my %x = %$x)'
+ );
+ my $y = get_y(); my @y = @$y; sub get_y { @y=(1..4); return \@y };
+ is(
+ "@y", "1 2 3 4",
+ 'bug 70171 (self-assignment via my @x = @$x)'
+ );
+}
+
"We're included by lib/Tie/Array/std.t so we need to return something true"; |
From @rgarcia2009/12/6 Father Chrysostomos <sprout@cpan.org>:
Even if you have an OP_PADSV on the left ? I think that in this case
Ok. |
@rgs - Status changed from 'open' to 'resolved' |
From @rgarcia2009/12/13 Father Chrysostomos <sprout@cpan.org>:
Thanks, applied to bleadperl as 0f907b9. |
From @avarOn Mon, Dec 14, 2009 at 15:31, Rafael Garcia-Suarez <rgs@consttype.org> wrote:
I added one extra test to that for good measure: It can be pulled from the rt-70171-extra-test branch on |
Migrated from rt.perl.org#70171 (status was 'resolved')
Searchable as RT70171$
The text was updated successfully, but these errors were encountered: