name, which is not permitted under C<use strict 'refs'>). Only C<&{}> did
not have this problem. This has been fixed.
+=item *
+
+A minor regression introduced in 5.15.0 has been fixed. Dereferencing a
+magical mortal (e.g., the return value of C<delete> on a tied hash element)
+explicitly returned from a subroutine called recursively was not calling
+C<FETCH>. This would affect code like C<@{ foo() }> where the C<foo> sub
+contains C<return delete $hash{elem}> and is calling itself.
+
=back
=head1 Known Problems
*++newsp = SvREFCNT_inc(*SP);
FREETMPS;
sv_2mortal(*newsp);
+ if (gmagic) SvGETMAGIC(*newsp);
}
else {
sv = SvREFCNT_inc(*SP); /* FREETMPS could clobber it */
FREETMPS;
*++newsp = sv_mortalcopy(sv);
SvREFCNT_dec(sv);
- if (gmagic) SvGETMAGIC(sv);
}
}
else if (SvTEMP(*SP) && SvREFCNT(*SP) == 1) {
() = sub { return delete $_{elem} }->()->[3];
expected_tie_calls $tied_to, 1, 0,
'mortal magic var is explicitly returned in autoviv context';
+
+ $tied_to = tie $_{elem}, "Tie::Monitor";
+ my $rsub;
+ $rsub = sub { if ($_[0]) { delete $_{elem} } else { &$rsub(1)->[3] } };
+ &$rsub;
+ expected_tie_calls $tied_to, 1, 0,
+ 'mortal magic var is implicitly returned in autoviv context';
+
+ $tied_to = tie $_{elem}, "Tie::Monitor";
+ $rsub = sub {
+ if ($_[0]) { return delete $_{elem} } else { &$rsub(1)->[3] }
+ };
+ &$rsub;
+ expected_tie_calls $tied_to, 1, 0,
+ 'mortal magic var is explicitly returned in autoviv context';
}
done_testing();