-
Notifications
You must be signed in to change notification settings - Fork 561
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
regression in list assignment with undef in list context #16685
Comments
From wolf-dietrich_moeller@t-online.deThe documentation on assignments in perlop reads: The following program shows a regression,
The newer version 5.26 (and also 5.28) works correctly if the my ($y, @s);
my $x = 5;
print 'test 1: ',scalar (@s = (($y) = (8,9))),' ',$y,' ',$x//'undef',"\n";
my $x = 5;
print 'test 2: ',scalar (@s = (($y,undef) = (8,9))),' ',$y,'
',$x//'undef',"\n";
my $x = 5;
print 'test 3: ',scalar (@s = (($y,undef,$x) = (8,9))),' ',$y,'
',$x//'undef',"\n";
my $x = 5;
print 'test 4: ',scalar (@s = (($y,undef,undef) = (8,9))),' ',$y,'
',$x//'undef',"\n";
|
From @iabynOn Fri, Sep 07, 2018 at 08:48:29AM -0700, Wolf-Dietrich Moeller (via RT) wrote:
Bisects to this. I haven't looked further yet. commit b09ed99 Handle list assignment in list context better -- |
The RT System itself - Status changed from 'new' to 'open' |
This is unchanged in 5.30 |
GH #16685 In @A = ($x, undef, undef) = (1)) @A should have 3 elements. v5.25.6-79-gb09ed995ad broke this and was returning one element. The fix is simple: that previous commit made it so that elements were pushed back onto the stack only if they weren't immortal, so &PL_sv_undef was getting skipped. Make it so they always are.
Now fixed in blead by commit v5.33.0-236-g282d9dfeb4 |
GH #16685 In @A = ($x, undef, undef) = (1)) @A should have 3 elements. v5.25.6-79-gb09ed995ad broke this and was returning one element. The fix is simple: that previous commit made it so that elements were pushed back onto the stack only if they weren't immortal, so &PL_sv_undef was getting skipped. Make it so they always are. (cherry picked from commit 282d9df)
Migrated from rt.perl.org#133503 (status was 'open')
Searchable as RT133503$
The text was updated successfully, but these errors were encountered: