summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-04-11 14:53:38 +0000
committerNicholas Clark <nick@ccl4.org>2005-04-11 14:53:38 +0000
commitf398eb67d321bfe2b4dd05cb57fa3c94a3337abc (patch)
tree726554b8eb3fa475c0947adbde895208e046729e /pp_hot.c
parentf024374aaec3af368c46dadae280209e8297c32a (diff)
downloadperl-f398eb67d321bfe2b4dd05cb57fa3c94a3337abc.tar.gz
Avoid taking a reference to SvIVX and putting that address on the
save stack p4raw-id: //depot/perl@24228
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 85b42aa016..b486586bc4 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2560,10 +2560,10 @@ S_get_db_sub(pTHX_ SV **svp, CV *cv)
{
SV *dbsv = GvSV(PL_DBsub);
+ save_item(dbsv);
if (!PERLDB_SUB_NN) {
GV *gv = CvGV(cv);
- save_item(dbsv);
if ( (CvFLAGS(cv) & (CVf_ANON | CVf_CLONED))
|| strEQ(GvNAME(gv), "END")
|| ((GvCV(gv) != cv) && /* Could be imported, and old sub redefined. */
@@ -2580,9 +2580,10 @@ S_get_db_sub(pTHX_ SV **svp, CV *cv)
}
}
else {
- (void)SvUPGRADE(dbsv, SVt_PVIV);
+ int type = SvTYPE(dbsv);
+ if (type < SVt_PVIV && type != SVt_IV)
+ sv_upgrade(dbsv, SVt_PVIV);
(void)SvIOK_on(dbsv);
- SAVEIV(SvIVX(dbsv));
SvIV_set(dbsv, PTR2IV(cv)); /* Do it the quickest way */
}