# This test depends on t/lib/Devel/switchd*.pm.
-plan(tests => 6);
+plan(tests => 7);
my $r;
qr "1\r?\n2\r?\n",
'Subroutines no longer found under their names can be called',
);
+
+# [rt.cpan.org #69862]
+like(
+ runperl(
+ switches => [ '-Ilib', '-d:switchd_empty' ],
+ progs => [
+ 'sub DB::sub { goto &$DB::sub }',
+ 'sub foo { goto &bar::baz; }',
+ 'sub bar::baz { print qq _ok\n_ }',
+ 'delete $::{bar::::};',
+ 'foo();',
+ ],
+ ),
+ qr "ok\r?\n",
+ 'No crash when calling orphaned subroutine via goto &',
+);
if (!PERLDB_SUB_NN) {
GV *gv = CvGV(cv);
- if ( svp && ((CvFLAGS(cv) & (CVf_ANON | CVf_CLONED))
+ if (!svp) {
+ gv_efullname3(dbsv, gv, NULL);
+ }
+ else if ( (CvFLAGS(cv) & (CVf_ANON | CVf_CLONED))
|| strEQ(GvNAME(gv), "END")
|| ( /* Could be imported, and old sub redefined. */
(GvCV(gv) != cv || !S_gv_has_usable_name(aTHX_ gv))
&& S_gv_has_usable_name(aTHX_ gv = (GV *)*svp)
)
)
- )) {
+ ) {
/* GV is potentially non-unique, or contain different CV. */
SV * const tmp = newRV(MUTABLE_SV(cv));
sv_setsv(dbsv, tmp);