diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-12-01 22:51:22 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-12-01 22:51:22 +0000 |
commit | 005a8a35ce5b6191102f848d17a5c617740a685c (patch) | |
tree | e37187ba38761daa9b8ddf12d4e36cecd9ab07ab /pp_hot.c | |
parent | a9ef256d686ebab6464dfd2ad06eb0aff1240f34 (diff) | |
download | perl-005a8a35ce5b6191102f848d17a5c617740a685c.tar.gz |
Make get_db_sub non-static, and call it from pp_goto, which allows the
removal of duplicate code. (The conversion of GvSV(PL_DBsub) to
GvSVn(PL_DBsub) implicit in this change should fix a failure with
Devel::SmallProf.)
p4raw-id: //depot/perl@29434
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -2683,20 +2683,23 @@ PP(pp_leavesublv) } -STATIC void -S_get_db_sub(pTHX_ SV **svp, CV *cv) +void +Perl_get_db_sub(pTHX_ SV **svp, CV *cv) { dVAR; SV * const dbsv = GvSVn(PL_DBsub); + /* We do not care about using sv to call CV; + * it's for informational purposes only. + */ save_item(dbsv); if (!PERLDB_SUB_NN) { GV * const gv = CvGV(cv); - if ( (CvFLAGS(cv) & (CVf_ANON | CVf_CLONED)) + if ( svp && ((CvFLAGS(cv) & (CVf_ANON | CVf_CLONED)) || strEQ(GvNAME(gv), "END") || ((GvCV(gv) != cv) && /* Could be imported, and old sub redefined. */ - !( (SvTYPE(*svp) == SVt_PVGV) && (GvCV((GV*)*svp) == cv) ))) { + !( (SvTYPE(*svp) == SVt_PVGV) && (GvCV((GV*)*svp) == cv) )))) { /* Use GV from the stack as a fallback. */ /* GV is potentially non-unique, or contain different CV. */ SV * const tmp = newRV((SV*)cv); @@ -2823,7 +2826,7 @@ try_autoload: if (CvASSERTION(cv) && PL_DBassertion) sv_setiv(PL_DBassertion, 1); - get_db_sub(&sv, cv); + Perl_get_db_sub(aTHX_ &sv, cv); if (CvISXSUB(cv)) PL_curcopdb = PL_curcop; cv = GvCV(PL_DBsub); |