SVt_BIND, /* 1 */
SVt_IV, /* 2 */
SVt_NV, /* 3 */
- SVt_RV, /* 4 */
- SVt_PV, /* 5 */
- SVt_PVIV, /* 6 */
- SVt_PVNV, /* 7 */
- SVt_PVMG, /* 8 */
+ /* RV was here, before it was merged with IV. */
+ SVt_PV, /* 4 */
+ SVt_PVIV, /* 5 */
+ SVt_PVNV, /* 6 */
+ SVt_PVMG, /* 7 */
+ SVt_ORANGE, /* 8 */
/* PVBM was here, before BIND replaced it. */
SVt_PVGV, /* 9 */
SVt_PVLV, /* 10 */
purposes eternal code wanting to consider PVBM probably needs to think of
PVMG instead. */
# define SVt_PVBM SVt_PVMG
+/* Anything wanting to create a reference from clean should ensure that it has
+ a scalar of type SVt_IV now: */
+# define SVt_RV SVt_IV
#endif
/* There is collusion here with sv_clear - sv_clear exits early for SVt_NULL
}))
# define SvRV(sv) \
(*({ SV *const _svi = (SV *) (sv); \
- assert(SvTYPE(_svi) >= SVt_RV); \
+ assert(SvTYPE(_svi) >= SVt_PV || SvTYPE(_svi) == SVt_IV); \
assert(SvTYPE(_svi) != SVt_PVAV); \
assert(SvTYPE(_svi) != SVt_PVHV); \
assert(SvTYPE(_svi) != SVt_PVCV); \
assert(!isGV_with_GP(sv)); \
(((XPVUV*)SvANY(sv))->xuv_uv = (val)); } STMT_END
#define SvRV_set(sv, val) \
- STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
+ STMT_START { assert(SvTYPE(sv) >= SVt_PV || SvTYPE(sv) == SVt_IV); \
assert(SvTYPE(sv) != SVt_PVAV); \
assert(SvTYPE(sv) != SVt_PVHV); \
assert(SvTYPE(sv) != SVt_PVCV); \
STMT_START { \
assert(SvTYPE(sv) >= SVt_PV); \
if (SvLEN(sv)) { \
+ assert(!SvROK(sv)); \
if(SvOOK(sv)) { \
SvPV_set(sv, SvPVX_mutable(sv) - SvIVX(sv)); \
SvFLAGS(sv) &= ~SVf_OOK; \
#define SvSHARE(sv) CALL_FPTR(PL_sharehook)(aTHX_ sv)
#define SvLOCK(sv) CALL_FPTR(PL_lockhook)(aTHX_ sv)
#define SvUNLOCK(sv) CALL_FPTR(PL_unlockhook)(aTHX_ sv)
+#define SvDESTROYABLE(sv) CALL_FPTR(PL_destroyhook)(aTHX_ sv)
#define SvGETMAGIC(x) STMT_START { if (SvGMAGICAL(x)) mg_get(x); } STMT_END
#define SvSETMAGIC(x) STMT_START { if (SvSMAGICAL(x)) mg_set(x); } STMT_END