{ sizeof(HE), 0, 0, SVt_NULL,
FALSE, NONV, NOARENA, FIT_ARENA(0, sizeof(HE)) },
+ /* The bind placeholder pretends to be an RV for now.
+ Also it's marked as "can't upgrade" top stop anyone using it before it's
+ implemented. */
+ { 0, 0, 0, SVt_BIND, TRUE, NONV, NOARENA, 0 },
+
/* IVs are in the head, so the allocation size is 0.
However, the slot is overloaded for PTEs. */
{ sizeof(struct ptr_tbl_ent), /* This is used for PTEs. */
/* RVs are in the head now. */
{ 0, 0, 0, SVt_RV, FALSE, NONV, NOARENA, 0 },
- /* The bind placeholder pretends to be an RV for now. */
- { 0, 0, 0, SVt_BIND, FALSE, NONV, NOARENA, 0 },
-
/* 8 bytes on most ILP32 with IEEE doubles */
{ sizeof(xpv_allocated),
copy_length(XPV, xpv_len)
typedef enum {
SVt_NULL, /* 0 */
- SVt_IV, /* 1 */
- SVt_NV, /* 2 */
- SVt_RV, /* 3 */
- SVt_BIND, /* 4 */
+ SVt_BIND, /* 1 */
+ SVt_IV, /* 2 */
+ SVt_NV, /* 3 */
+ SVt_RV, /* 4 */
SVt_PV, /* 5 */
SVt_PVIV, /* 6 */
SVt_PVNV, /* 7 */
#define assert_not_glob(sv)
#endif
-#define SvOK(sv) (SvFLAGS(sv) & SVf_OK)
+#define SvOK(sv) ((SvTYPE(sv) == SVt_BIND) \
+ ? (SvFLAGS(SvRV(sv)) & SVf_OK) \
+ : (SvFLAGS(sv) & SVf_OK))
#define SvOK_off(sv) (assert_not_ROK(sv) assert_not_glob(sv) \
SvFLAGS(sv) &= ~(SVf_OK| \
SVf_IVisUV|SVf_UTF8), \