This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_aassign(): fix ($x,$y) = (undef, $x)
authorDavid Mitchell <davem@iabyn.com>
Wed, 2 Sep 2015 11:28:12 +0000 (12:28 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 2 Sep 2015 12:24:07 +0000 (13:24 +0100)
commit9ae0115f0b854d654461d3c5bbcaa938516d0f4e
treef616832001893b6be1fa106e3d1b4bd7be6e8c4d
parentebc643cee5f3ca37421efb5ec01dc07b7be2904e
pp_aassign(): fix ($x,$y) = (undef, $x)

With 808ce5578203, I tweaked the OPpASSIGN_COMMON flagging to mark as safe
when the LHS or RHS only contains only one var. This turned out to be
flawed for the RHS logic, as position as well as oneness is important:

   (undef, $x) = ...;         # only 1 scalar on LHS: always safe
   ($x, $y)    = (undef, $x); # 2 scalars on RHS: unsafe

So this commit makes undef on the RHS count towards the scalar var count.
op.c
pp_hot.c
t/op/aassign.t
t/perf/benchmarks