This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
B::PV::PV doesn't need a special case for pad names post 5.9.x
authorNicholas Clark <nick@ccl4.org>
Fri, 29 Oct 2010 11:01:11 +0000 (12:01 +0100)
committerNicholas Clark <nick@ccl4.org>
Fri, 29 Oct 2010 11:01:11 +0000 (12:01 +0100)
The PV-related flags on SVs used to store names in pads were made sane by
commit 931b58fb28fa5ca7.

ext/B/B.xs

index 70a3e0b..381d5a9 100644 (file)
@@ -1423,13 +1423,16 @@ SvPV(sv)
         if( SvPOK(sv) ) {
            STRLEN len = SvCUR(sv);
            const char *p = SvPVX_const(sv);
-           /* FIXME - we need a better way for B to identify PVs that are
-              in the pads as variable names.  */
+#if PERL_VERSION < 10
+           /* Before 5.10 (well 931b58fb28fa5ca7), PAD_COMPNAME_GEN was stored
+              in SvCUR(), which meant we had to attempt this special casing
+              to avoid tripping up over variable names in the pads.  */
            if((SvLEN(sv) && len >= SvLEN(sv))) {
                /* It claims to be longer than the space allocated for it -
                   presuambly it's a variable name in the pad  */
                len = strlen(p);
            }
+#endif
            ST(0) = newSVpvn_flags(p, len, SVs_TEMP | SvUTF8(sv));
         }
         else {