This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use cv_name in pp_hot.c:sub_crush_depth
authorFather Chrysostomos <sprout@cpan.org>
Fri, 12 Sep 2014 05:53:42 +0000 (22:53 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 15 Sep 2014 13:19:34 +0000 (06:19 -0700)
The next commit will allow lexical subs with GVs to reach this code
path, so use cv_name, since it knows how to handle those.

pp_hot.c

index 9e6df2a..2624a71 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2804,17 +2804,8 @@ Perl_sub_crush_depth(pTHX_ CV *cv)
     if (CvANON(cv))
        Perl_warner(aTHX_ packWARN(WARN_RECURSION), "Deep recursion on anonymous subroutine");
     else {
-        HEK *const hek = CvNAME_HEK(cv);
-        SV *tmpstr;
-        if (hek) {
-            tmpstr = sv_2mortal(newSVhek(hek));
-        }
-        else {
-            tmpstr = sv_newmortal();
-            gv_efullname3(tmpstr, CvGV(cv), NULL);
-        }
        Perl_warner(aTHX_ packWARN(WARN_RECURSION), "Deep recursion on subroutine \"%"SVf"\"",
-                   SVfARG(tmpstr));
+                   SVfARG(cv_name(cv,NULL)));
     }
 }