This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_ctl.c:pp_dbstate: Don’t adjust CvDEPTH for XSUBs
authorFather Chrysostomos <sprout@cpan.org>
Fri, 17 Aug 2012 06:44:11 +0000 (23:44 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 17 Aug 2012 23:45:21 +0000 (16:45 -0700)
Commit c127bd3aaa5c5 made XS DB::DB subs work.  Before that,
pp_dbstate assumed DB::DB was written it perl.  It adjusts CvDEPTH
when calling the XSUB, which serves no purpose.  It was presumably
just copied from the pure-Perl-calling code.  pp_entersub does-
n’t do this.

pp_ctl.c

index 55d9c89..b9b26e5 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1973,10 +1973,8 @@ PP(pp_dbstate)
        SPAGAIN;
 
        if (CvISXSUB(cv)) {
-           CvDEPTH(cv)++;
            PUSHMARK(SP);
            (void)(*CvXSUB(cv))(aTHX_ cv);
-           CvDEPTH(cv)--;
            FREETMPS;
            LEAVE;
            return NORMAL;