PL_secondgv = MUTABLE_GV(SvREFCNT_inc(
gv_fetchpvs("b", GV_ADD|GV_NOTQUAL, SVt_PV)
));
+ /* make sure the GP isn't removed out from under us for
+ * the SAVESPTR() */
+ save_gp(PL_firstgv, 0);
+ save_gp(PL_secondgv, 0);
+ /* we don't want modifications localized */
+ GvINTRO_off(PL_firstgv);
+ GvINTRO_off(PL_secondgv);
SAVESPTR(GvSV(PL_firstgv));
SAVESPTR(GvSV(PL_secondgv));
}
set_up_inc('../lib');
}
use warnings;
-plan(tests => 193);
+plan(tests => 195);
# these shouldn't hang
{
::is (join('-', sort f2 3,1,2,4), '1-2-3-4', "Ret: f2");
::is (join('-', sort f3 3,1,2,4), '1-2-3-4', "Ret: f3");
}
+
+{
+ @a = sort{ *a=0; 1} 0..1;
+ pass "No crash when GP deleted out from under us [perl 124097]";
+
+ no warnings 'redefine';
+ # some alternative non-solutions localized modifications to *a and *b
+ sub a { 0 };
+ @a = sort { *a = sub { 1 }; $a <=> $b } 0 .. 1;
+ ok(a(), "*a wasn't localized inadvertantly");
+}