This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
list assign in list context: honour LHS undef
authorDavid Mitchell <davem@iabyn.com>
Tue, 11 Aug 2020 12:58:51 +0000 (13:58 +0100)
committerDavid Mitchell <davem@iabyn.com>
Tue, 11 Aug 2020 15:14:39 +0000 (16:14 +0100)
commit282d9dfeb4cea3c2d0335ba78faa3a9db931f1ec
tree82468f79aa701c857383a33bb134c02cac54d8ac
parent5b354d2a8a6fea46c62048464c6722560cb1c907
list assign in list context: honour LHS undef

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.
pp_hot.c
t/op/aassign.t