(*({ GV * const _gvname_hek = (GV *) (gv); \
assert(isGV_with_GP(_gvname_hek)); \
assert(SvTYPE(_gvname_hek) == SVt_PVGV || SvTYPE(_gvname_hek) >= SVt_PVLV); \
- assert(!SvVALID((SV*)_gvname_hek)); \
&(GvXPVGV(_gvname_hek)->xiv_u.xivu_namehek); \
}))
# define GvNAME_get(gv) ({ assert(GvNAME_HEK(gv)); (char *)HEK_KEY(GvNAME_HEK(gv)); })
}
if (SvVALID(sv) || isREGEXP(sv)) {
- /* FBMs use the space for SvIVX and SvNVX for other purposes, and use
- the same flag bit as SVf_IVisUV, so must not let them cache IVs.
+ /* FBMs use the space for SvIVX and SvNVX for other purposes, so
+ must not let them cache IVs.
In practice they are extremely unlikely to actually get anywhere
accessible by user Perl code - the only way that I'm aware of is when
a constant subroutine which is used as the second argument to index.
/* If we're in a stash, we don't own a reference to it.
* However it does have a back reference to us, which
* needs to be cleared. */
- if (!SvVALID(sv) && (stash = GvSTASH(sv)))
+ if ((stash = GvSTASH(sv)))
sv_del_backref(MUTABLE_SV(stash), sv);
}
/* FIXME. There are probably more unreferenced pointers to SVs
/* Does the SV have a Boyer-Moore table attached as magic?
* 'VALID' is a poor name, but is kept for historical reasons. */
#define SvVALID(_svvalid) ( \
- SvSMAGICAL(_svvalid) \
+ SvPOKp(_svvalid) \
+ && SvSMAGICAL(_svvalid) \
&& SvMAGIC(_svvalid) \
&& (SvMAGIC(_svvalid)->mg_type == PERL_MAGIC_bm \
|| mg_find(_svvalid, PERL_MAGIC_bm)) \
const unsigned char *little = (const unsigned char *)SvPV_const(littlestr,l);
STRLEN littlelen = l;
const I32 multiline = flags & FBMrf_MULTILINE;
- bool tail = SvVALID(littlestr) ? cBOOL(SvTAIL(littlestr)) : FALSE;
+ bool valid = SvVALID(littlestr);
+ bool tail = valid ? cBOOL(SvTAIL(littlestr)) : FALSE;
PERL_ARGS_ASSERT_FBM_INSTR;
return NULL;
}
- if (!SvVALID(littlestr)) {
+ if (!valid) {
/* not compiled; use Perl_ninstr() instead */
char * const b = ninstr((char*)big,(char*)bigend,
(char*)little, (char*)little + littlelen);