Revert "Create SVt_INVLIST"
authorKarl Williamson <public@khwilliamson.com>
Fri, 5 Jul 2013 00:55:11 +0000 (18:55 -0600)
committerKarl Williamson <public@khwilliamson.com>
Fri, 5 Jul 2013 01:06:35 +0000 (19:06 -0600)
This reverts commit e045dbedc7da04e20cc8cfccec8a2e3ccc62cc8b.
Blead won't compile with address sanitizer;  commit
7cb47964955167736b2923b008cc8023a9b035e8 reverting an earlier commit
failed to fix that.  I'm trying two more reversions to get it back
working.  This is one of those

dist/Storable/Storable.pm
dist/Storable/Storable.xs
dump.c
ext/B/B.xs
perl.h
sv.c
sv.h

index 5f63871..1a73c3f 100644 (file)
@@ -21,7 +21,7 @@ package Storable; @ISA = qw(Exporter);
 
 use vars qw($canonical $forgive_me $VERSION);
 
-$VERSION = '2.44';
+$VERSION = '2.43';
 
 BEGIN {
     if (eval { local $SIG{__DIE__}; require Log::Agent; 1 }) {
index f21f053..08641cd 100644 (file)
@@ -3469,7 +3469,7 @@ static int sv_type(pTHX_ SV *sv)
        case SVt_PVCV:
                return svis_CODE;
 #if PERL_VERSION > 8
-       /* case SVt_INVLIST: */
+       /* case SVt_DUMMY: */
 #endif
        default:
                break;
diff --git a/dump.c b/dump.c
index 6ba4fd2..5ca838b 100644 (file)
--- a/dump.c
+++ b/dump.c
 #include "perl.h"
 #include "regcomp.h"
 
+
 static const char* const svtypenames[SVt_LAST] = {
     "NULL",
+    "DUMMY",
     "IV",
     "NV",
     "PV",
-    "INVLIST",
     "PVIV",
     "PVNV",
     "PVMG",
@@ -49,10 +50,10 @@ static const char* const svtypenames[SVt_LAST] = {
 
 static const char* const svshorttypenames[SVt_LAST] = {
     "UNDEF",
+    "DUMMY",
     "IV",
     "NV",
     "PV",
-    "INVLST",
     "PVIV",
     "PVNV",
     "PVMG",
@@ -2797,7 +2798,7 @@ Perl_sv_xmlpeek(pTHX_ SV *sv)
     case SVt_PVGV:
        sv_catpv(t, " GV=\"");
        break;
-    case SVt_INVLIST:
+    case SVt_DUMMY:
        sv_catpv(t, " DUMMY=\"");
        break;
     case SVt_REGEXP:
index e7049f0..fbe6be6 100644 (file)
@@ -21,13 +21,13 @@ typedef FILE * InputStream;
 
 static const char* const svclassnames[] = {
     "B::NULL",
+    "B::BIND",
     "B::IV",
     "B::NV",
 #if PERL_VERSION <= 10
     "B::RV",
 #endif
     "B::PV",
-    "B::INVLIST",
     "B::PVIV",
     "B::PVNV",
     "B::PVMG",
diff --git a/perl.h b/perl.h
index 16e339c..0593461 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -5043,19 +5043,19 @@ EXTCONST U8 PL_magic_data[256];
 #endif
 
 #ifdef DOINIT
-                       /* NL IV NV PV INV PI PN MG RX GV LV AV HV CV FM IO */
+                       /* NL BD IV NV PV PI PN MG RX GV LV AV HV CV FM IO */
 EXTCONST bool
-PL_valid_types_IVX[]    = { 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0 };
+PL_valid_types_IVX[]    = { 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0 };
 EXTCONST bool
-PL_valid_types_NVX[]    = { 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0 };
+PL_valid_types_NVX[]    = { 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0 };
 EXTCONST bool
-PL_valid_types_PVX[]    = { 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1 };
+PL_valid_types_PVX[]    = { 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1 };
 EXTCONST bool
-PL_valid_types_RV[]     = { 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1 };
+PL_valid_types_RV[]     = { 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1 };
 EXTCONST bool
-PL_valid_types_IV_set[] = { 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1 };
+PL_valid_types_IV_set[] = { 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1 };
 EXTCONST bool
-PL_valid_types_NV_set[] = { 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
+PL_valid_types_NV_set[] = { 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
 
 #else
 
diff --git a/sv.c b/sv.c
index 25aad04..0e33556 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -881,6 +881,11 @@ static const struct body_details bodies_by_type[] = {
     /* HEs use this offset for their arena.  */
     { 0, 0, 0, SVt_NULL, FALSE, NONV, NOARENA, 0 },
 
+    /* The bind placeholder pretends to be an RV for now.
+       Also it's marked as "can't upgrade" to stop anyone using it before it's
+       implemented.  */
+    { 0, 0, 0, SVt_DUMMY, TRUE, NONV, NOARENA, 0 },
+
     /* IVs are in the head, so the allocation size is 0.  */
     { 0,
       sizeof(IV), /* This is used to copy out the IV body.  */
@@ -898,11 +903,6 @@ static const struct body_details bodies_by_type[] = {
       SVt_PV, FALSE, NONV, HASARENA,
       FIT_ARENA(0, sizeof(XPV) - STRUCT_OFFSET(XPV, xpv_cur)) },
 
-    /* The invlist placeholder pretends to be an RV for now.
-       Also it's marked as "can't upgrade" to stop anyone using it before it's
-       implemented.  */
-    { 0, 0, 0, SVt_INVLIST, TRUE, NONV, NOARENA, 0 },
-
     { sizeof(XPVIV) - STRUCT_OFFSET(XPV, xpv_cur),
       copy_length(XPVIV, xiv_u) - STRUCT_OFFSET(XPV, xpv_cur),
       + STRUCT_OFFSET(XPV, xpv_cur),
@@ -4117,7 +4117,7 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, SV* sstr, const I32 flags)
        }
        break;
 
-       /* case SVt_INVLIST: */
+       /* case SVt_DUMMY: */
     case SVt_PVLV:
     case SVt_PVGV:
     case SVt_PVMG:
@@ -6184,7 +6184,7 @@ Perl_sv_clear(pTHX_ SV *const orig_sv)
                SvREFCNT_dec(SvSTASH(sv));
        }
        switch (type) {
-           /* case SVt_INVLIST: */
+           /* case SVt_DUMMY: */
        case SVt_PVIO:
            if (IoIFP(sv) &&
                IoIFP(sv) != PerlIO_stdin() &&
@@ -9446,7 +9446,7 @@ Perl_sv_reftype(pTHX_ const SV *const sv, const int ob)
                                    ? "GLOB" : "SCALAR");
        case SVt_PVFM:          return "FORMAT";
        case SVt_PVIO:          return "IO";
-       case SVt_INVLIST:       return "INVLIST";
+       case SVt_DUMMY:         return "DUMMY";
        case SVt_REGEXP:        return "REGEXP";
        default:                return "UNKNOWN";
        }
@@ -12183,7 +12183,7 @@ S_sv_dup_common(pTHX_ const SV *const sstr, CLONE_PARAMS *const param)
        SvANY(dstr)     = new_XNV();
        SvNV_set(dstr, SvNVX(sstr));
        break;
-       /* case SVt_INVLIST: */
+       /* case SVt_DUMMY: */
     default:
        {
            /* These are all the types that need complex bodies allocating.  */
diff --git a/sv.h b/sv.h
index 475da61..0c1ded6 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -29,7 +29,6 @@ The types are:
     SVt_PVIV
     SVt_PVNV
     SVt_PVMG
-    SVt_INVLIST
     SVt_REGEXP
     SVt_PVGV
     SVt_PVLV
@@ -57,8 +56,7 @@ typeglob has been assigned.  Assigning to it again will stop it from being
 a typeglob.  SVt_PVLV represents a scalar that delegates to another scalar
 behind the scenes.  It is used, e.g., for the return value of C<substr> and
 for tied hash and array elements.  It can hold any scalar value, including
-a typeglob. SVt_REGEXP is for regular expressions.  SVt_INVLIST is for Perl
-core internal use only.
+a typeglob. SVt_REGEXP is for regular expressions.
 
 SVt_PVMG represents a "normal" scalar (not a typeglob, regular expression,
 or delegate).  Since most scalars do not need all the internal fields of a
@@ -92,9 +90,6 @@ Type flag for scalars.  See L</svtype>.
 =for apidoc AmU||SVt_PVMG
 Type flag for scalars.  See L</svtype>.
 
-=for apidoc AmU||SVt_INVLIST
-Type flag for scalars.  See L</svtype>.
-
 =for apidoc AmU||SVt_REGEXP
 Type flag for regular expressions.  See L</svtype>.
 
@@ -124,12 +119,11 @@ Type flag for I/O objects.  See L</svtype>.
 
 typedef enum {
        SVt_NULL,       /* 0 */
-       /* BIND was here, before INVLIST replaced it.  */
-       SVt_IV,         /* 1 */
-       SVt_NV,         /* 2 */
+       SVt_DUMMY,      /* 1 */
+       SVt_IV,         /* 2 */
+       SVt_NV,         /* 3 */
        /* RV was here, before it was merged with IV.  */
-       SVt_PV,         /* 3 */
-       SVt_INVLIST,    /* 4, implemented as a PV */
+       SVt_PV,         /* 4 */
        SVt_PVIV,       /* 5 */
        SVt_PVNV,       /* 6 */
        SVt_PVMG,       /* 7 */
@@ -146,9 +140,7 @@ typedef enum {
 } svtype;
 
 /* *** any alterations to the SV types above need to be reflected in
- * SVt_MASK and the various PL_valid_types_* tables.  As of this writing those
- * tables are in perl.h.  There are also two affected names tables in dump.c,
- * one in B.xs, and 'bodies_by_type[]' in sv.c */
+ * SVt_MASK and the various PL_valid_types_* tables */
 
 #define SVt_MASK 0xf   /* smallest bitmask that covers all types */