This commit allows PP lvalue subs to return temps with set magic
and removes TODO from tests.
}
{
- local $TODO = "PP lvalue sub can't return magical temp";
my $x = "{}";
eval { make_temp_mg_lv($x) = "b"; };
is($@, '', 'temp mg lv from pp exception check');
MARK = newsp + 1;
EXTEND_MORTAL(1);
if (MARK == SP) {
- /* Temporaries are bad unless they happen to be elements
- * of a tied hash or array */
+ /* Temporaries are bad unless they happen to have set magic
+ * attached, such as the elements of a tied hash or array */
if ((SvFLAGS(TOPs) & (SVs_TEMP | SVs_PADTMP) ||
(SvFLAGS(TOPs) & (SVf_READONLY | SVf_FAKE))
== SVf_READONLY
) &&
- !(SvRMAGICAL(TOPs) && mg_find(TOPs, PERL_MAGIC_tiedelem))) {
+ !SvSMAGICAL(TOPs)) {
LEAVE;
cxstack_ix--;
POPSUB(cx,sv);