In perl.git, the branch sprout/cvgv has been updated <http://perl5.git.perl.org/perl.git/commitdiff/4eeb8e59dfc84b110c42e34f0d494bf4cdbc0f34?hp=386d11ea771590426c05969db2ffbf3e26b2c3b5>
- Log ----------------------------------------------------------------- commit 4eeb8e59dfc84b110c42e34f0d494bf4cdbc0f34 Author: Father Chrysostomos <[email protected]> Date: Fri Sep 12 20:18:09 2014 -0700 fixup for âAvoid creating GVsâ M universal.c commit 9510854a2c1afe164cf7384e33d2c23e3d20db6c Author: Father Chrysostomos <[email protected]> Date: Fri Sep 12 20:16:08 2014 -0700 fixup for lexical CvGV M universal.c ----------------------------------------------------------------------- Summary of changes: universal.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/universal.c b/universal.c index c219411..359c5977 100644 --- a/universal.c +++ b/universal.c @@ -302,11 +302,12 @@ C<croak()>. Hence if C<cv> is C<&ouch::awk>, it would call C<croak> as: void Perl_croak_xs_usage(const CV *const cv, const char *const params) { - const GV *const gv = CvGV(cv); + /* Avoid CvGV as it requires aTHX. */ + const GV *const gv = CvNAMED(cv) ? NULL : cv->sv_any->xcv_gv_u.xcv_gv; PERL_ARGS_ASSERT_CROAK_XS_USAGE; - if (gv) { + if (gv) got_gv: { const HV *const stash = GvSTASH(gv); if (HvNAME_get(stash)) @@ -320,6 +321,9 @@ Perl_croak_xs_usage(const CV *const cv, const char *const params) Perl_croak_nocontext("Usage: %"HEKf"(%s)", HEKfARG(GvNAME_HEK(gv)), params); } else { + dTHX; + if ((gv = CvGV(cv))) goto got_gv; + /* Pants. I don't think that it should be possible to get here. */ /* diag_listed_as: SKIPME */ Perl_croak_nocontext("Usage: CODE(0x%"UVxf")(%s)", PTR2UV(cv), params); -- Perl5 Master Repository
