has been corrected. C<undef()> is now treated like other undefined
scalars, as in Perl 5.005.
+=item *
+
+It used to be possible to free the typeglob of a localised array or hash
+(e.g., C<local @{"x"}; delete $::{x}>), resulting in a crash on scope exit.
+
=back
=head1 Known Problems
if (!AvREAL(oav) && AvREIFY(oav))
av_reify(oav);
- save_pushptrptr(gv, oav, SAVEt_AV);
+ save_pushptrptr(SvREFCNT_inc_simple_NN(gv), oav, SAVEt_AV);
GvAV(gv) = NULL;
av = GvAVn(gv);
PERL_ARGS_ASSERT_SAVE_HASH;
- save_pushptrptr(gv, (ohv = GvHVn(gv)), SAVEt_HV);
+ save_pushptrptr(
+ SvREFCNT_inc_simple_NN(gv), (ohv = GvHVn(gv)), SAVEt_HV
+ );
GvHV(gv) = NULL;
hv = GvHVn(gv);
SvSETMAGIC(MUTABLE_SV(av));
PL_localizing = 0;
}
+ SvREFCNT_dec(gv);
break;
case SAVEt_HV: /* hash reference */
hv = MUTABLE_HV(SSPOPPTR);
SvSETMAGIC(MUTABLE_SV(hv));
PL_localizing = 0;
}
+ SvREFCNT_dec(gv);
break;
case SAVEt_INT_SMALL:
ptr = SSPOPPTR;
@INC = qw(. ../lib);
require './test.pl';
}
-plan tests => 306;
+plan tests => 307;
my $list_assignment_supported = 1;
'index(q(a), foo);' .
'local *g=${::}{foo};print q(ok);'), "ok", "[perl #52740]");
-# Keep this test last, as it can SEGV
+# Keep these tests last, as they can SEGV
{
local *@;
pass("Localised *@");
eval {1};
pass("Can eval with *@ localised");
-}
+ local @{"nugguton"};
+ local %{"netgonch"};
+ delete $::{$_} for 'nugguton','netgonch';
+}
+pass ('localised arrays and hashes do not crash if glob is deleted');