diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-12-31 00:08:00 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-12-31 00:08:00 +0000 |
commit | 1cb9cd5016282146cd55ab904078500def5f5754 (patch) | |
tree | 4952a1cfb2e8ca1b21b5c8c452ec04043a27857e /sv.h | |
parent | f6fd7794b9baf00eb9b1d47e4ad481f2e8866e76 (diff) | |
download | perl-1cb9cd5016282146cd55ab904078500def5f5754.tar.gz |
Move SVt_BIND to be the lowest type after SVt_NULL. This will force all
code attempting to upgrade a BIND to anything into sv_upgrade(), which
for now will croak, but in future can DTRT, for whatever TRT is decided
to be. Make SvOK() check the flags of the referenant for a BIND, as I
envisage that the only flag bit that will get set on a BIND is SVf_UTF8
even if the referant has a defined value.
p4raw-id: //depot/perl@29642
Diffstat (limited to 'sv.h')
-rw-r--r-- | sv.h | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -45,10 +45,10 @@ Type flag for code refs. See C<svtype>. 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 */ @@ -942,7 +942,9 @@ Set the actual length of the string which is in the SV. See C<SvIV_set>. #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), \ |