summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorLukas Mai <l.mai@web.de>2013-06-18 09:51:32 +0200
committerFather Chrysostomos <sprout@cpan.org>2013-06-18 06:22:08 -0700
commit07b2687d22462e599adb759b7c0082fb12b3f33d (patch)
treea4ae3bf6ace6feddf89135f0a4cf0532b4ca25e7 /pp_hot.c
parent6daa8d508141a8730166526fd60c532162680a2f (diff)
downloadperl-07b2687d22462e599adb759b7c0082fb12b3f33d.tar.gz
don't crash on deep recursion warnings in lexical subs (#118521)
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/pp_hot.c b/pp_hot.c
index e19776b35a..c493d40610 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2895,8 +2895,15 @@ Perl_sub_crush_depth(pTHX_ CV *cv)
if (CvANON(cv))
Perl_warner(aTHX_ packWARN(WARN_RECURSION), "Deep recursion on anonymous subroutine");
else {
- SV* const tmpstr = sv_newmortal();
- gv_efullname3(tmpstr, CvGV(cv), NULL);
+ 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));
}