Skip Menu |

This queue is for tickets about the Sub-Name CPAN distribution.

Report information
The Basics
Id: 59558
Status: resolved
Priority: 0/
Queue: Sub-Name

People
Owner: Nobody in particular
Requestors: leon [...] astray.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Broken in perl-5.13.3
Heya, Thanks for a fab module! However, it no longer compiles under 5.13.3: Name.xs:90: error: lvalue required as left operand of assignment Line 90 is: CvGV(cv) = gv; The perldelta says: Under some circumstances, the C<CvGV()> field of a CV is now reference counted. To ensure consistent behaviour, direct assignment to it, for example C<CvGV(cv) = gv> is now a compile-time error. A new macro, C<CvGV_set(cv,gv)> has been introduced to perform this operation safely. Note that modification of this field is not part of of the public API, regardless of this new macro. This change caused some L<issues|/"Known Problems"> in modules that used the private C<GvGV()> field. And http://code.activestate.com/lists/perl5-porters/153869/ implies that Dave has sent you a patch, but I couldn't see it on RT thus I have added it for now. Hope that's fine. Cheers, Leon.
Attached patch fixes both 5.13.3 issues. -- Reini Urban
Subject: Sub-Name-5.13.3.patch
difforig diff -u ./Name.xs.orig --- ./Name.xs.orig 2008-07-18 15:23:41.000000000 +0200 +++ ./Name.xs 2010-07-20 20:11:54.540875000 +0200 @@ -41,7 +41,12 @@ else if (!SvOK(sub)) croak(PL_no_usym, "a subroutine"); else if (PL_op->op_private & HINT_STRICT_REFS) +#if PERL_VERSION < 13 croak(PL_no_symref, SvPV_nolen(sub), "a subroutine"); +#else + croak("Can't use string (\"%.32s\") as %s ref while \"strict refs\" in use", + SvPV_nolen(sub), "a subroutine"); +#endif else if ((gv = gv_fetchpv(SvPV_nolen(sub), FALSE, SVt_PVCV))) cv = GvCVu(gv); if (!cv) @@ -87,5 +92,9 @@ mg->mg_flags |= MGf_REFCOUNTED; mg->mg_obj = (SV *) gv; } - CvGV(cv) = gv; +#if PERL_VERSION < 13 + CvGV(cv) = gv; +#else + CvGV_set(cv,gv); +#endif PUSHs(sub);
A stop gap solution: to install Sub-Name with above pach from the CPAN.pm shell I've written the distroprefs file http://github.com/andk/cpanpm/blob/master/distroprefs/XMATH.Sub-Name.yml
A lightly better patch (as suggested by zefram on #p5p) conditional on #ifdef CvGV_set -- Reini Urban
Subject: Sub-Name-5.13.3.patch
Sub::Name broken in blead since 5.13.3 https://rt.cpan.org/Public/Bug/Display.html?id=59558 diff -u ./Name.xs.orig --- ./Name.xs.orig 2008-07-18 15:23:41.000000000 +0200 +++ ./Name.xs 2010-07-20 20:11:54.540875000 +0200 @@ -41,7 +41,12 @@ else if (!SvOK(sub)) croak(PL_no_usym, "a subroutine"); else if (PL_op->op_private & HINT_STRICT_REFS) +#if PERL_VERSION < 13 croak(PL_no_symref, SvPV_nolen(sub), "a subroutine"); +#else + croak("Can't use string (\"%.32s\") as %s ref while \"strict refs\" in use", + SvPV_nolen(sub), "a subroutine"); +#endif else if ((gv = gv_fetchpv(SvPV_nolen(sub), FALSE, SVt_PVCV))) cv = GvCVu(gv); if (!cv) @@ -87,5 +92,9 @@ mg->mg_flags |= MGf_REFCOUNTED; mg->mg_obj = (SV *) gv; } - CvGV(cv) = gv; +#ifndef CvGV_set + CvGV(cv) = gv; +#else + CvGV_set(cv,gv); +#endif PUSHs(sub);