summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-12-01 22:51:22 +0000
committerNicholas Clark <nick@ccl4.org>2006-12-01 22:51:22 +0000
commit005a8a35ce5b6191102f848d17a5c617740a685c (patch)
treee37187ba38761daa9b8ddf12d4e36cecd9ab07ab /pp_hot.c
parenta9ef256d686ebab6464dfd2ad06eb0aff1240f34 (diff)
downloadperl-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.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 4f35993061..8c48576524 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -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);