summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-09-16 14:49:03 -0700
committerFather Chrysostomos <sprout@cpan.org>2014-09-16 15:51:05 -0700
commite0a18850467d4ef5eb9a7d577ae2474bbd348e46 (patch)
treeccea5ec63cfc2c1aba436ded1705cffebce89fcc /util.c
parent53bf589c2bebd53656b4421b1347b21f130e6802 (diff)
downloadperl-e0a18850467d4ef5eb9a7d577ae2474bbd348e46.tar.gz
Fix $DB::sub in DB::goto for lexical subs
$ PERL5DB='sub DB::DB{}' ./perl -Ilib -XMfeature=:all -de ' state sub f{}; sub DB::goto { warn $DB::sub } $^P|=0x80; sub {goto &f}->()' main::f at -e line 1. There should not be a package name. Lexical subs should be treated like anonymous subs here; $DB::sub should contain a reference. This bug was introduced recently, in ae77754ae. Before that the output was: CODE(0x7fdbf102de58) at -e line 1. Though before 9d8e4b9b3 it was: Segmentation fault: 11
Diffstat (limited to 'util.c')
-rw-r--r--util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util.c b/util.c
index f3071380aa..e87813bfaa 100644
--- a/util.c
+++ b/util.c
@@ -5349,10 +5349,10 @@ Perl_get_db_sub(pTHX_ SV **svp, CV *cv)
if (!PERLDB_SUB_NN) {
GV *gv = CvGV(cv);
- if (gv && !svp) {
+ if (!svp && !CvLEXICAL(cv)) {
gv_efullname3(dbsv, gv, NULL);
}
- else if ( (CvFLAGS(cv) & (CVf_ANON | CVf_CLONED)) || !gv
+ else if ( (CvFLAGS(cv) & (CVf_ANON | CVf_CLONED)) || CvLEXICAL(cv)
|| strEQ(GvNAME(gv), "END")
|| ( /* Could be imported, and old sub redefined. */
(GvCV(gv) != cv || !S_gv_has_usable_name(aTHX_ gv))