From 49cf1d6641a6dfd301302f616e4f25595dcc65d4 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 4 Jul 2013 18:55:11 -0600 Subject: [PATCH] Revert "Create SVt_INVLIST" 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 | 2 +- dist/Storable/Storable.xs | 2 +- dump.c | 7 ++++--- ext/B/B.xs | 2 +- perl.h | 14 +++++++------- sv.c | 18 +++++++++--------- sv.h | 20 ++++++-------------- 7 files changed, 29 insertions(+), 36 deletions(-) diff --git a/dist/Storable/Storable.pm b/dist/Storable/Storable.pm index 5f63871..1a73c3f 100644 --- a/dist/Storable/Storable.pm +++ b/dist/Storable/Storable.pm @@ -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 }) { diff --git a/dist/Storable/Storable.xs b/dist/Storable/Storable.xs index f21f053..08641cd 100644 --- a/dist/Storable/Storable.xs +++ b/dist/Storable/Storable.xs @@ -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 --- a/dump.c +++ b/dump.c @@ -27,12 +27,13 @@ #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: diff --git a/ext/B/B.xs b/ext/B/B.xs index e7049f0..fbe6be6 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -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 --- 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 --- 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 --- 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 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. =for apidoc AmU||SVt_PVMG Type flag for scalars. See L. -=for apidoc AmU||SVt_INVLIST -Type flag for scalars. See L. - =for apidoc AmU||SVt_REGEXP Type flag for regular expressions. See L. @@ -124,12 +119,11 @@ Type flag for I/O objects. See L. 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 */ -- 2.7.4