diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-04-11 14:53:38 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-04-11 14:53:38 +0000 |
commit | f398eb67d321bfe2b4dd05cb57fa3c94a3337abc (patch) | |
tree | 726554b8eb3fa475c0947adbde895208e046729e /pp_hot.c | |
parent | f024374aaec3af368c46dadae280209e8297c32a (diff) | |
download | perl-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.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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 */ } |