Remove the pp_entersub specific logic from S_get_db_sub.
Nicholas Clark [Fri, 1 Dec 2006 22:28:11 +0000 (22:28 +0000)]
p4raw-id: //depot/perl@29433

embed.fnc
pp_hot.c
proto.h

index 3b1a68e..eeff4c2 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -1277,7 +1277,7 @@ s |OP*    |do_smartmatch  |NULLOK HV* seen_this|NULLOK HV* seen_other
 
 #if defined(PERL_IN_PP_HOT_C) || defined(PERL_DECL_PROT)
 s      |void   |do_oddball     |NN HV *hash|NN SV **relem|NN SV **firstrelem
-sR     |CV*    |get_db_sub     |NN SV **svp|NN CV *cv
+s      |void   |get_db_sub     |NN SV **svp|NN CV *cv
 sR     |SV*    |method_common  |NN SV* meth|NULLOK U32* hashp
 #endif
 
index cdf8337..4f35993 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2683,7 +2683,7 @@ PP(pp_leavesublv)
 }
 
 
-STATIC CV *
+STATIC void
 S_get_db_sub(pTHX_ SV **svp, CV *cv)
 {
     dVAR;
@@ -2714,11 +2714,6 @@ S_get_db_sub(pTHX_ SV **svp, CV *cv)
        (void)SvIOK_on(dbsv);
        SvIV_set(dbsv, PTR2IV(cv));     /* Do it the quickest way  */
     }
-
-    if (CvISXSUB(cv))
-       PL_curcopdb = PL_curcop;
-    cv = GvCV(PL_DBsub);
-    return cv;
 }
 
 PP(pp_entersub)
@@ -2828,7 +2823,11 @@ try_autoload:
         if (CvASSERTION(cv) && PL_DBassertion)
            sv_setiv(PL_DBassertion, 1);
        
-       cv = get_db_sub(&sv, cv);
+        get_db_sub(&sv, cv);
+        if (CvISXSUB(cv))
+            PL_curcopdb = PL_curcop;
+        cv = GvCV(PL_DBsub);
+
        if (!cv || (!CvXSUB(cv) && !CvSTART(cv)))
            DIE(aTHX_ "No DB::sub routine defined");
     }
diff --git a/proto.h b/proto.h
index 9add7e0..821f42c 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -3465,8 +3465,7 @@ STATIC void       S_do_oddball(pTHX_ HV *hash, SV **relem, SV **firstrelem)
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_3);
 
-STATIC CV*     S_get_db_sub(pTHX_ SV **svp, CV *cv)
-                       __attribute__warn_unused_result__
+STATIC void    S_get_db_sub(pTHX_ SV **svp, CV *cv)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);