From: David Mitchell Date: Sat, 20 Jan 2024 21:28:38 +0000 (-0500) Subject: Quick and simple fix to make Variable-Magic pass again under blead. X-Git-Tag: rt151104^0 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FVariable-Magic.git;a=commitdiff_plain;h=cdc5231a1c56c4eb1d731e59eb5b525477e538b6 Quick and simple fix to make Variable-Magic pass again under blead. The test file t/18-opinfo.t in Variable-Magic makes some assumptions about which ops are used to implement various perl constructs. A year ago, an optimisation was added to the perl core in the form of the new OP_PADSV_STORE op. Just recently in blead, v5.39.6-108-gc90e7ed39e, it has been changed slightly so that the optimisation is only applied in void context. The ops in 18-opinfo.t are called in scalar context, so the optimisation is no longer applied, so the op is no longer what is expected. The diff below just ensures that the three relevant expressions are called in void context, ensuring that the optimisation still takes place. This seemed an easier fix than adding further code along the lines of 'if ($] > 5.0039006) ....', and will also not require further work if the change in blead is reverted for whatever reason. --- diff --git a/t/18-opinfo.t b/t/18-opinfo.t index 0147a6c..0013345 100644 --- a/t/18-opinfo.t +++ b/t/18-opinfo.t @@ -39,13 +39,15 @@ our @o; my @tests = ( [ 'len', '@c', 'my @c', 'my $x = @c', [ 'padav', 'B::OP' ] ], - [ 'get', '$c[0]', 'my @c', 'my $x = $c[0]', [ $aelem, 'B::OP' ] ], - [ 'get', '$o[0]', 'local @o', 'my $x = $o[0]', [ $aelemf, $aelemf_op ] ], + [ 'get', '$c[0]', 'my @c', 'my $x = $c[0]; 1', + [ $aelem, 'B::OP' ] ], + [ 'get', '$o[0]', 'local @o', 'my $x = $o[0]; 1', + [ $aelemf, $aelemf_op ] ], [ 'get', '$x->{a}', 'my $x', 'my $y = $x->{a}{b}', [ $deref, $deref_op ] ], [ 'get', '$c', 'my $c = 1', '++$c', [ 'preinc', 'B::UNOP' ] ], [ 'get', '$c', 'my $c = 1', '$c ** 2', [ 'pow', 'B::BINOP' ] ], - [ 'get', '$c', 'my $c = 1', 'my $x = $c', [ $assign_op, $assign_op_cl ] ], + [ 'get', '$c', 'my $c = 1', 'my $x = $c; 1', [ $assign_op, $assign_op_cl ] ], [ 'get', '$c', 'my $c = 1', '1 if $c', [ 'and', 'B::LOGOP' ] ], [ 'get', '$c', 'my $c = []', 'ref $c', [ 'ref', 'B::UNOP' ] ], [ 'get', '$c', 'my $c = $0', '-f $c', [ 'ftfile', 'B::UNOP' ] ],