summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-02-12 13:15:20 +0000
committerNicholas Clark <nick@ccl4.org>2008-02-12 13:15:20 +0000
commit7918f24d20384771923d344a382e1d16d9552018 (patch)
tree627e24f3c520f70ddfd3fc9779420bd72fd00c55 /sv.c
parent9f10164a6c9d93684fedbbc188fb9dfe004c22c4 (diff)
downloadperl-7918f24d20384771923d344a382e1d16d9552018.tar.gz
assert() that every NN argument is not NULL. Otherwise we have the
ability to create landmines that will explode under someone in the future when they upgrade their compiler to one with better optimisation. We've already done this at least twice. (Yes, some of the assertions are after code that would already have SEGVd because it already deferences a pointer, but they are put in to make it easier to automate checking that each and every case is covered.) Add a tool, checkARGS_ASSERT.pl, to check that every case is covered. p4raw-id: //depot/perl@33291
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c314
1 files changed, 307 insertions, 7 deletions
diff --git a/sv.c b/sv.c
index 41374b2c44..d0f9edb477 100644
--- a/sv.c
+++ b/sv.c
@@ -159,6 +159,9 @@ Perl_offer_nice_chunk(pTHX_ void *const chunk, const U32 chunk_size)
dVAR;
void *new_chunk;
U32 new_chunk_size;
+
+ PERL_ARGS_ASSERT_OFFER_NICE_CHUNK;
+
new_chunk = (void *)(chunk);
new_chunk_size = (chunk_size);
if (new_chunk_size > PL_nice_chunk_size) {
@@ -291,6 +294,9 @@ STATIC void
S_del_sv(pTHX_ SV *p)
{
dVAR;
+
+ PERL_ARGS_ASSERT_DEL_SV;
+
if (DEBUG_D_TEST) {
SV* sva;
bool ok = 0;
@@ -339,6 +345,8 @@ Perl_sv_add_arena(pTHX_ char *const ptr, const U32 size, const U32 flags)
register SV* sv;
register SV* svend;
+ PERL_ARGS_ASSERT_SV_ADD_ARENA;
+
/* The first SV in an arena isn't an SV. */
SvANY(sva) = (void *) PL_sv_arenaroot; /* ptr to next arena */
SvREFCNT(sva) = size / sizeof(SV); /* number of SV slots */
@@ -376,6 +384,8 @@ S_visit(pTHX_ SVFUNC_t f, const U32 flags, const U32 mask)
SV* sva;
I32 visited = 0;
+ PERL_ARGS_ASSERT_VISIT;
+
for (sva = PL_sv_arenaroot; sva; sva = (SV*)SvANY(sva)) {
register const SV * const svend = &sva[SvREFCNT(sva)];
register SV* sv;
@@ -1125,6 +1135,8 @@ Perl_sv_upgrade(pTHX_ register SV *const sv, svtype new_type)
= bodies_by_type + old_type;
SV *referant = NULL;
+ PERL_ARGS_ASSERT_SV_UPGRADE;
+
if (new_type != SVt_PV && SvIsCOW(sv)) {
sv_force_normal_flags(sv, 0);
}
@@ -1402,7 +1414,10 @@ Perl_sv_backoff(pTHX_ register SV *const sv)
{
STRLEN delta;
const char * const s = SvPVX_const(sv);
+
+ PERL_ARGS_ASSERT_SV_BACKOFF;
PERL_UNUSED_CONTEXT;
+
assert(SvOOK(sv));
assert(SvTYPE(sv) != SVt_PVHV);
assert(SvTYPE(sv) != SVt_PVAV);
@@ -1431,6 +1446,8 @@ Perl_sv_grow(pTHX_ register SV *const sv, register STRLEN newlen)
{
register char *s;
+ PERL_ARGS_ASSERT_SV_GROW;
+
if (PL_madskills && newlen >= 0x100000) {
PerlIO_printf(Perl_debug_log,
"Allocation too large: %"UVxf"\n", (UV)newlen);
@@ -1498,6 +1515,9 @@ void
Perl_sv_setiv(pTHX_ register SV *const sv, const IV i)
{
dVAR;
+
+ PERL_ARGS_ASSERT_SV_SETIV;
+
SV_CHECK_THINKFIRST_COW_DROP(sv);
switch (SvTYPE(sv)) {
case SVt_NULL:
@@ -1534,6 +1554,8 @@ Like C<sv_setiv>, but also handles 'set' magic.
void
Perl_sv_setiv_mg(pTHX_ register SV *const sv, const IV i)
{
+ PERL_ARGS_ASSERT_SV_SETIV_MG;
+
sv_setiv(sv,i);
SvSETMAGIC(sv);
}
@@ -1550,6 +1572,8 @@ Does not handle 'set' magic. See also C<sv_setuv_mg>.
void
Perl_sv_setuv(pTHX_ register SV *const sv, const UV u)
{
+ PERL_ARGS_ASSERT_SV_SETUV;
+
/* With these two if statements:
u=1.49 s=0.52 cu=72.49 cs=10.64 scripts=270 tests=20865
@@ -1578,6 +1602,8 @@ Like C<sv_setuv>, but also handles 'set' magic.
void
Perl_sv_setuv_mg(pTHX_ register SV *const sv, const UV u)
{
+ PERL_ARGS_ASSERT_SV_SETUV_MG;
+
sv_setuv(sv,u);
SvSETMAGIC(sv);
}
@@ -1595,6 +1621,9 @@ void
Perl_sv_setnv(pTHX_ register SV *const sv, const NV num)
{
dVAR;
+
+ PERL_ARGS_ASSERT_SV_SETNV;
+
SV_CHECK_THINKFIRST_COW_DROP(sv);
switch (SvTYPE(sv)) {
case SVt_NULL:
@@ -1632,6 +1661,8 @@ Like C<sv_setnv>, but also handles 'set' magic.
void
Perl_sv_setnv_mg(pTHX_ register SV *const sv, const NV num)
{
+ PERL_ARGS_ASSERT_SV_SETNV_MG;
+
sv_setnv(sv,num);
SvSETMAGIC(sv);
}
@@ -1648,6 +1679,8 @@ S_not_a_number(pTHX_ SV *const sv)
char tmpbuf[64];
const char *pv;
+ PERL_ARGS_ASSERT_NOT_A_NUMBER;
+
if (DO_UTF8(sv)) {
dsv = newSVpvs_flags("", SVs_TEMP);
pv = sv_uni_display(dsv, sv, 10, 0);
@@ -1727,6 +1760,8 @@ Perl_looks_like_number(pTHX_ SV *const sv)
register const char *sbegin;
STRLEN len;
+ PERL_ARGS_ASSERT_LOOKS_LIKE_NUMBER;
+
if (SvPOK(sv)) {
sbegin = SvPVX_const(sv);
len = SvCUR(sv);
@@ -1744,6 +1779,8 @@ S_glob_2number(pTHX_ GV * const gv)
const U32 wasfake = SvFLAGS(gv) & SVf_FAKE;
SV *const buffer = sv_newmortal();
+ PERL_ARGS_ASSERT_GLOB_2NUMBER;
+
/* FAKE globs can get coerced, so need to turn this off temporarily if it
is on. */
SvFAKE_off(gv);
@@ -1765,6 +1802,8 @@ S_glob_2pv(pTHX_ GV * const gv, STRLEN * const len)
const U32 wasfake = SvFLAGS(gv) & SVf_FAKE;
SV *const buffer = sv_newmortal();
+ PERL_ARGS_ASSERT_GLOB_2PV;
+
/* FAKE globs can get coerced, so need to turn this off temporarily if it
is on. */
SvFAKE_off(gv);
@@ -1870,6 +1909,9 @@ S_sv_2iuv_non_preserve(pTHX_ register SV *const sv
)
{
dVAR;
+
+ PERL_ARGS_ASSERT_SV_2IUV_NON_PRESERVE;
+
DEBUG_c(PerlIO_printf(Perl_debug_log,"sv_2iuv_non '%s', IV=0x%"UVxf" NV=%"NVgf" inttype=%"UVXf"\n", SvPVX_const(sv), SvIVX(sv), SvNVX(sv), (UV)numtype));
if (SvNVX(sv) < (NV)IV_MIN) {
(void)SvIOKp_on(sv);
@@ -1915,8 +1957,12 @@ S_sv_2iuv_non_preserve(pTHX_ register SV *const sv
#endif /* !NV_PRESERVES_UV*/
STATIC bool
-S_sv_2iuv_common(pTHX_ SV *const sv) {
+S_sv_2iuv_common(pTHX_ SV *const sv)
+{
dVAR;
+
+ PERL_ARGS_ASSERT_SV_2IUV_COMMON;
+
if (SvNOKp(sv)) {
/* erm. not sure. *should* never get NOKp (without NOK) from sv_2nv
* without also getting a cached IV/UV from it at the same time
@@ -2579,6 +2625,8 @@ access this function.
SV *
Perl_sv_2num(pTHX_ register SV *const sv)
{
+ PERL_ARGS_ASSERT_SV_2NUM;
+
if (!SvROK(sv))
return sv;
if (SvAMAGIC(sv)) {
@@ -2603,6 +2651,8 @@ S_uiv_2buf(char *const buf, const IV iv, UV uv, const int is_uv, char **const pe
char * const ebuf = ptr;
int sign;
+ PERL_ARGS_ASSERT_UIV_2BUF;
+
if (is_uv)
sign = 0;
else if (iv >= 0) {
@@ -2923,6 +2973,9 @@ Perl_sv_copypv(pTHX_ SV *const dsv, register SV *const ssv)
{
STRLEN len;
const char * const s = SvPV_const(ssv,len);
+
+ PERL_ARGS_ASSERT_SV_COPYPV;
+
sv_setpvn(dsv,s,len);
if (SvUTF8(ssv))
SvUTF8_on(dsv);
@@ -2945,6 +2998,8 @@ Usually accessed via the C<SvPVbyte> macro.
char *
Perl_sv_2pvbyte(pTHX_ register SV *const sv, STRLEN *const lp)
{
+ PERL_ARGS_ASSERT_SV_2PVBYTE;
+
sv_utf8_downgrade(sv,0);
return lp ? SvPV(sv,*lp) : SvPV_nolen(sv);
}
@@ -2963,6 +3018,8 @@ Usually accessed via the C<SvPVutf8> macro.
char *
Perl_sv_2pvutf8(pTHX_ register SV *sv, STRLEN *lp)
{
+ PERL_ARGS_ASSERT_SV_2PVUTF8;
+
sv_utf8_upgrade(sv);
return lp ? SvPV(sv,*lp) : SvPV_nolen(sv);
}
@@ -2981,6 +3038,9 @@ bool
Perl_sv_2bool(pTHX_ register SV *sv)
{
dVAR;
+
+ PERL_ARGS_ASSERT_SV_2BOOL;
+
SvGETMAGIC(sv);
if (!SvOK(sv))
@@ -3049,6 +3109,9 @@ STRLEN
Perl_sv_utf8_upgrade_flags(pTHX_ register SV *sv, I32 flags)
{
dVAR;
+
+ PERL_ARGS_ASSERT_SV_UTF8_UPGRADE_FLAGS;
+
if (sv == &PL_sv_undef)
return 0;
if (!SvPOK(sv)) {
@@ -3119,6 +3182,9 @@ bool
Perl_sv_utf8_downgrade(pTHX_ register SV* sv, bool fail_ok)
{
dVAR;
+
+ PERL_ARGS_ASSERT_SV_UTF8_DOWNGRADE;
+
if (SvPOKp(sv) && SvUTF8(sv)) {
if (SvCUR(sv)) {
U8 *s;
@@ -3158,6 +3224,8 @@ flag off so that it looks like octets again.
void
Perl_sv_utf8_encode(pTHX_ register SV *sv)
{
+ PERL_ARGS_ASSERT_SV_UTF8_ENCODE;
+
if (SvIsCOW(sv)) {
sv_force_normal_flags(sv, 0);
}
@@ -3183,6 +3251,8 @@ Scans PV for validity and returns false if the PV is invalid UTF-8.
bool
Perl_sv_utf8_decode(pTHX_ register SV *sv)
{
+ PERL_ARGS_ASSERT_SV_UTF8_DECODE;
+
if (SvPOKp(sv)) {
const U8 *c;
const U8 *e;
@@ -3251,6 +3321,8 @@ S_glob_assign_glob(pTHX_ SV *dstr, SV *sstr, const int dtype)
{
I32 mro_changes = 0; /* 1 = method, 2 = isa */
+ PERL_ARGS_ASSERT_GLOB_ASSIGN_GLOB;
+
if (dtype != SVt_PVGV) {
const char * const name = GvNAME(sstr);
const STRLEN len = GvNAMELEN(sstr);
@@ -3322,7 +3394,8 @@ S_glob_assign_glob(pTHX_ SV *dstr, SV *sstr, const int dtype)
}
static void
-S_glob_assign_ref(pTHX_ SV *dstr, SV *sstr) {
+S_glob_assign_ref(pTHX_ SV *dstr, SV *sstr)
+{
SV * const sref = SvREFCNT_inc(SvRV(sstr));
SV *dref = NULL;
const int intro = GvINTRO(dstr);
@@ -3330,6 +3403,7 @@ S_glob_assign_ref(pTHX_ SV *dstr, SV *sstr) {
U8 import_flag = 0;
const U32 stype = SvTYPE(sref);
+ PERL_ARGS_ASSERT_GLOB_ASSIGN_REF;
#ifdef GV_UNIQUE_CHECK
if (GvUNIQUE((GV*)dstr)) {
@@ -3440,6 +3514,8 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
register int dtype;
register svtype stype;
+ PERL_ARGS_ASSERT_SV_SETSV_FLAGS;
+
if (sstr == dstr)
return;
@@ -3870,6 +3946,8 @@ Like C<sv_setsv>, but also handles 'set' magic.
void
Perl_sv_setsv_mg(pTHX_ SV *dstr, register SV *sstr)
{
+ PERL_ARGS_ASSERT_SV_SETSV_MG;
+
sv_setsv(dstr,sstr);
SvSETMAGIC(dstr);
}
@@ -3882,6 +3960,8 @@ Perl_sv_setsv_cow(pTHX_ SV *dstr, SV *sstr)
STRLEN len = SvLEN(sstr);
register char *new_pv;
+ PERL_ARGS_ASSERT_SV_SETSV_COW;
+
if (DEBUG_C_TEST) {
PerlIO_printf(Perl_debug_log, "Fast copy on write: %p -> %p\n",
(void*)sstr, (void*)dstr);
@@ -3959,6 +4039,8 @@ Perl_sv_setpvn(pTHX_ register SV *sv, register const char *ptr, register STRLEN
dVAR;
register char *dptr;
+ PERL_ARGS_ASSERT_SV_SETPVN;
+
SV_CHECK_THINKFIRST_COW_DROP(sv);
if (!ptr) {
(void)SvOK_off(sv);
@@ -3991,6 +4073,8 @@ Like C<sv_setpvn>, but also handles 'set' magic.
void
Perl_sv_setpvn_mg(pTHX_ register SV *sv, register const char *ptr, register STRLEN len)
{
+ PERL_ARGS_ASSERT_SV_SETPVN_MG;
+
sv_setpvn(sv,ptr,len);
SvSETMAGIC(sv);
}
@@ -4010,6 +4094,8 @@ Perl_sv_setpv(pTHX_ register SV *sv, register const char *ptr)
dVAR;
register STRLEN len;
+ PERL_ARGS_ASSERT_SV_SETPV;
+
SV_CHECK_THINKFIRST_COW_DROP(sv);
if (!ptr) {
(void)SvOK_off(sv);
@@ -4036,6 +4122,8 @@ Like C<sv_setpv>, but also handles 'set' magic.
void
Perl_sv_setpv_mg(pTHX_ register SV *sv, register const char *ptr)
{
+ PERL_ARGS_ASSERT_SV_SETPV_MG;
+
sv_setpv(sv,ptr);
SvSETMAGIC(sv);
}
@@ -4065,6 +4153,9 @@ Perl_sv_usepvn_flags(pTHX_ SV *sv, char *ptr, STRLEN len, U32 flags)
{
dVAR;
STRLEN allocate;
+
+ PERL_ARGS_ASSERT_SV_USEPVN_FLAGS;
+
SV_CHECK_THINKFIRST_COW_DROP(sv);
SvUPGRADE(sv, SVt_PV);
if (!ptr) {
@@ -4119,6 +4210,8 @@ Perl_sv_usepvn_flags(pTHX_ SV *sv, char *ptr, STRLEN len, U32 flags)
STATIC void
S_sv_release_COW(pTHX_ register SV *sv, const char *pvx, SV *after)
{
+ PERL_ARGS_ASSERT_SV_RELEASE_COW;
+
{ /* this SV was SvIsCOW_normal(sv) */
/* we need to find the SV pointing to us. */
SV *current = SV_COW_NEXT_SV(after);
@@ -4166,6 +4259,9 @@ void
Perl_sv_force_normal_flags(pTHX_ register SV *sv, U32 flags)
{
dVAR;
+
+ PERL_ARGS_ASSERT_SV_FORCE_NORMAL_FLAGS;
+
#ifdef PERL_OLD_COPY_ON_WRITE
if (SvREADONLY(sv)) {
/* At this point I believe I should acquire a global SV mutex. */
@@ -4258,6 +4354,8 @@ Perl_sv_chop(pTHX_ register SV *sv, register const char *ptr)
const U8 *real_start;
#endif
+ PERL_ARGS_ASSERT_SV_CHOP;
+
if (!ptr || !SvPOKp(sv))
return;
delta = ptr - SvPVX_const(sv);
@@ -4339,6 +4437,8 @@ Perl_sv_catpvn_flags(pTHX_ register SV *dsv, register const char *sstr, register
STRLEN dlen;
const char * const dstr = SvPV_force_flags(dsv, dlen, flags);
+ PERL_ARGS_ASSERT_SV_CATPVN_FLAGS;
+
SvGROW(dsv, dlen + slen + 1);
if (sstr == dstr)
sstr = SvPVX_const(dsv);
@@ -4371,7 +4471,10 @@ void
Perl_sv_catsv_flags(pTHX_ SV *dsv, register SV *ssv, I32 flags)
{
dVAR;
- if (ssv) {
+
+ PERL_ARGS_ASSERT_SV_CATSV_FLAGS;
+
+ if (ssv) {
STRLEN slen;
const char *spv = SvPV_const(ssv, slen);
if (spv) {
@@ -4424,6 +4527,8 @@ Perl_sv_catpv(pTHX_ register SV *sv, register const char *ptr)
STRLEN tlen;
char *junk;
+ PERL_ARGS_ASSERT_SV_CATPV;
+
if (!ptr)
return;
junk = SvPV_force(sv, tlen);
@@ -4448,6 +4553,8 @@ Like C<sv_catpv>, but also handles 'set' magic.
void
Perl_sv_catpv_mg(pTHX_ register SV *sv, register const char *ptr)
{
+ PERL_ARGS_ASSERT_SV_CATPV_MG;
+
sv_catpv(sv,ptr);
SvSETMAGIC(sv);
}
@@ -4508,6 +4615,8 @@ Perl_sv_magicext(pTHX_ SV* sv, SV* obj, int how, const MGVTBL *vtable,
dVAR;
MAGIC* mg;
+ PERL_ARGS_ASSERT_SV_MAGICEXT;
+
SvUPGRADE(sv, SVt_PVMG);
Newxz(mg, 1, MAGIC);
mg->mg_moremagic = SvMAGIC(sv);
@@ -4591,6 +4700,8 @@ Perl_sv_magic(pTHX_ register SV *sv, SV *obj, int how, const char *name, I32 nam
const MGVTBL *vtable;
MAGIC* mg;
+ PERL_ARGS_ASSERT_SV_MAGIC;
+
#ifdef PERL_OLD_COPY_ON_WRITE
if (SvIsCOW(sv))
sv_force_normal_flags(sv, 0);
@@ -4774,6 +4885,9 @@ Perl_sv_unmagic(pTHX_ SV *sv, int type)
{
MAGIC* mg;
MAGIC** mgp;
+
+ PERL_ARGS_ASSERT_SV_UNMAGIC;
+
if (SvTYPE(sv) < SVt_PVMG || !SvMAGIC(sv))
return 0;
mgp = &(((XPVMG*) SvANY(sv))->xmg_u.xmg_magic);
@@ -4823,6 +4937,9 @@ SV *
Perl_sv_rvweaken(pTHX_ SV *sv)
{
SV *tsv;
+
+ PERL_ARGS_ASSERT_SV_RVWEAKEN;
+
if (!SvOK(sv)) /* let undefs pass */
return sv;
if (!SvROK(sv))
@@ -4849,6 +4966,8 @@ Perl_sv_add_backref(pTHX_ SV *tsv, SV *sv)
dVAR;
AV *av;
+ PERL_ARGS_ASSERT_SV_ADD_BACKREF;
+
if (SvTYPE(tsv) == SVt_PVHV) {
AV **const avp = Perl_hv_backreferences_p(aTHX_ (HV*)tsv);
@@ -4905,6 +5024,8 @@ S_sv_del_backref(pTHX_ SV *tsv, SV *sv)
SV **svp;
I32 i;
+ PERL_ARGS_ASSERT_SV_DEL_BACKREF;
+
if (SvTYPE(tsv) == SVt_PVHV && SvOOK(tsv)) {
av = *Perl_hv_backreferences_p(aTHX_ (HV*)tsv);
/* We mustn't attempt to "fix up" the hash here by moving the
@@ -4952,6 +5073,7 @@ Perl_sv_kill_backrefs(pTHX_ SV *sv, AV *av)
{
SV **svp = AvARRAY(av);
+ PERL_ARGS_ASSERT_SV_KILL_BACKREFS;
PERL_UNUSED_ARG(sv);
/* Not sure why the av can get freed ahead of its sv, but somehow it does
@@ -5009,6 +5131,7 @@ Perl_sv_insert(pTHX_ SV *bigstr, STRLEN offset, STRLEN len, const char *little,
register I32 i;
STRLEN curlen;
+ PERL_ARGS_ASSERT_SV_INSERT;
if (!bigstr)
Perl_croak(aTHX_ "Can't modify non-existent substring");
@@ -5099,6 +5222,9 @@ Perl_sv_replace(pTHX_ register SV *sv, register SV *nsv)
{
dVAR;
const U32 refcnt = SvREFCNT(sv);
+
+ PERL_ARGS_ASSERT_SV_REPLACE;
+
SV_CHECK_THINKFIRST_COW_DROP(sv);
if (SvREFCNT(nsv) != 1) {
Perl_croak(aTHX_ "panic: reference miscount on nsv in sv_replace() (%"
@@ -5182,7 +5308,7 @@ Perl_sv_clear(pTHX_ register SV *sv)
= bodies_by_type + type;
HV *stash;
- assert(sv);
+ PERL_ARGS_ASSERT_SV_CLEAR;
assert(SvREFCNT(sv) == 0);
assert(SvTYPE(sv) != SVTYPEMASK);
@@ -5469,6 +5595,9 @@ void
Perl_sv_free2(pTHX_ SV *sv)
{
dVAR;
+
+ PERL_ARGS_ASSERT_SV_FREE2;
+
#ifdef DEBUGGING
if (SvTEMP(sv)) {
if (ckWARN_d(WARN_DEBUGGING))
@@ -5588,6 +5717,8 @@ S_sv_pos_u2b_forwards(const U8 *const start, const U8 *const send,
{
const U8 *s = start;
+ PERL_ARGS_ASSERT_SV_POS_U2B_FORWARDS;
+
while (s < send && uoffset--)
s += UTF8SKIP(s);
if (s > send) {
@@ -5606,6 +5737,9 @@ S_sv_pos_u2b_midway(const U8 *const start, const U8 *send,
STRLEN uoffset, STRLEN uend)
{
STRLEN backw = uend - uoffset;
+
+ PERL_ARGS_ASSERT_SV_POS_U2B_MIDWAY;
+
if (uoffset < 2 * backw) {
/* The assumption is that going forwards is twice the speed of going
forward (that's where the 2 * backw comes from).
@@ -5632,10 +5766,13 @@ S_sv_pos_u2b_midway(const U8 *const start, const U8 *send,
static STRLEN
S_sv_pos_u2b_cached(pTHX_ SV *sv, MAGIC **mgp, const U8 *const start,
const U8 *const send, STRLEN uoffset,
- STRLEN uoffset0, STRLEN boffset0) {
+ STRLEN uoffset0, STRLEN boffset0)
+{
STRLEN boffset = 0; /* Actually always set, but let's keep gcc happy. */
bool found = FALSE;
+ PERL_ARGS_ASSERT_SV_POS_U2B_CACHED;
+
assert (uoffset >= uoffset0);
if (SvMAGICAL(sv) && !SvREADONLY(sv) && PL_utf8cache
@@ -5753,6 +5890,8 @@ Perl_sv_pos_u2b(pTHX_ register SV *sv, I32* offsetp, I32* lenp)
const U8 *start;
STRLEN len;
+ PERL_ARGS_ASSERT_SV_POS_U2B;
+
if (!sv)
return;
@@ -5813,6 +5952,9 @@ S_utf8_mg_pos_cache_update(pTHX_ SV *sv, MAGIC **mgp, STRLEN byte, STRLEN utf8,
STRLEN blen)
{
STRLEN *cache;
+
+ PERL_ARGS_ASSERT_UTF8_MG_POS_CACHE_UPDATE;
+
if (SvREADONLY(sv))
return;
@@ -5952,6 +6094,8 @@ S_sv_pos_b2u_midway(pTHX_ const U8 *s, const U8 *const target, const U8 *end,
const STRLEN forw = target - s;
STRLEN backw = end - target;
+ PERL_ARGS_ASSERT_SV_POS_B2U_MIDWAY;
+
if (forw < 2 * backw) {
return utf8_length(s, target);
}
@@ -5993,6 +6137,8 @@ Perl_sv_pos_b2u(pTHX_ register SV* sv, I32* offsetp)
const U8* send;
bool found = FALSE;
+ PERL_ARGS_ASSERT_SV_POS_B2U;
+
if (!sv)
return;
@@ -6336,6 +6482,8 @@ Perl_sv_collxfrm(pTHX_ SV *sv, STRLEN *nxp)
dVAR;
MAGIC *mg;
+ PERL_ARGS_ASSERT_SV_COLLXFRM;
+
mg = SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_collxfrm) : (MAGIC *) NULL;
if (!mg || !mg->mg_ptr || *(U32*)mg->mg_ptr != PL_collation_ix) {
const char *s;
@@ -6403,6 +6551,8 @@ Perl_sv_gets(pTHX_ register SV *sv, register PerlIO *fp, I32 append)
I32 i = 0;
I32 rspara = 0;
+ PERL_ARGS_ASSERT_SV_GETS;
+
if (SvTHINKFIRST(sv))
sv_force_normal_flags(sv, append ? 0 : SV_COW_DROP_PV);
/* XXX. If you make this PVIV, then copy on write can copy scalars read
@@ -7313,6 +7463,9 @@ Perl_newSVpvf_nocontext(const char* pat, ...)
dTHX;
register SV *sv;
va_list args;
+
+ PERL_ARGS_ASSERT_NEWSVPVF_NOCONTEXT;
+
va_start(args, pat);
sv = vnewSVpvf(pat, &args);
va_end(args);
@@ -7334,6 +7487,9 @@ Perl_newSVpvf(pTHX_ const char* pat, ...)
{
register SV *sv;
va_list args;
+
+ PERL_ARGS_ASSERT_NEWSVPVF;
+
va_start(args, pat);
sv = vnewSVpvf(pat, &args);
va_end(args);
@@ -7347,6 +7503,9 @@ Perl_vnewSVpvf(pTHX_ const char* pat, va_list* args)
{
dVAR;
register SV *sv;
+
+ PERL_ARGS_ASSERT_VNEWSVPVF;
+
new_SV(sv);
sv_vsetpvfn(sv, pat, strlen(pat), args, NULL, 0, NULL);
return sv;
@@ -7445,6 +7604,9 @@ Perl_newRV_noinc(pTHX_ SV *tmpRef)
{
dVAR;
register SV *sv = newSV_type(SVt_IV);
+
+ PERL_ARGS_ASSERT_NEWRV_NOINC;
+
SvTEMP_off(tmpRef);
SvRV_set(sv, tmpRef);
SvROK_on(sv);
@@ -7459,6 +7621,9 @@ SV *
Perl_newRV(pTHX_ SV *sv)
{
dVAR;
+
+ PERL_ARGS_ASSERT_NEWRV;
+
return newRV_noinc(SvREFCNT_inc_simple_NN(sv));
}
@@ -7507,6 +7672,8 @@ Perl_sv_reset(pTHX_ register const char *s, HV *stash)
dVAR;
char todo[PERL_UCHAR_MAX+1];
+ PERL_ARGS_ASSERT_SV_RESET;
+
if (!stash)
return;
@@ -7609,6 +7776,8 @@ Perl_sv_2io(pTHX_ SV *sv)
IO* io;
GV* gv;
+ PERL_ARGS_ASSERT_SV_2IO;
+
switch (SvTYPE(sv)) {
case SVt_PVIO:
io = (IO*)sv;
@@ -7653,6 +7822,8 @@ Perl_sv_2cv(pTHX_ SV *sv, HV **st, GV **gvp, I32 lref)
GV *gv = NULL;
CV *cv = NULL;
+ PERL_ARGS_ASSERT_SV_2CV;
+
if (!sv) {
*st = NULL;
*gvp = NULL;
@@ -7787,6 +7958,9 @@ char *
Perl_sv_pvn_force_flags(pTHX_ SV *sv, STRLEN *lp, I32 flags)
{
dVAR;
+
+ PERL_ARGS_ASSERT_SV_PVN_FORCE_FLAGS;
+
if (SvTHINKFIRST(sv) && !SvROK(sv))
sv_force_normal_flags(sv, 0);
@@ -7844,6 +8018,8 @@ The backend for the C<SvPVbytex_force> macro. Always use the macro instead.
char *
Perl_sv_pvbyten_force(pTHX_ SV *sv, STRLEN *lp)
{
+ PERL_ARGS_ASSERT_SV_PVBYTEN_FORCE;
+
sv_pvn_force(sv,lp);
sv_utf8_downgrade(sv,0);
*lp = SvCUR(sv);
@@ -7861,6 +8037,8 @@ The backend for the C<SvPVutf8x_force> macro. Always use the macro instead.
char *
Perl_sv_pvutf8n_force(pTHX_ SV *sv, STRLEN *lp)
{
+ PERL_ARGS_ASSERT_SV_PVUTF8N_FORCE;
+
sv_pvn_force(sv,lp);
sv_utf8_upgrade(sv);
*lp = SvCUR(sv);
@@ -7878,6 +8056,8 @@ Returns a string describing what the SV is a reference to.
const char *
Perl_sv_reftype(pTHX_ const SV *sv, int ob)
{
+ PERL_ARGS_ASSERT_SV_REFTYPE;
+
/* The fact that I don't need to downcast to char * everywhere, only in ?:
inside return suggests a const propagation bug in g++. */
if (ob && SvOBJECT(sv)) {
@@ -7956,6 +8136,9 @@ int
Perl_sv_isa(pTHX_ SV *sv, const char *name)
{
const char *hvname;
+
+ PERL_ARGS_ASSERT_SV_ISA;
+
if (!sv)
return 0;
SvGETMAGIC(sv);
@@ -7988,6 +8171,8 @@ Perl_newSVrv(pTHX_ SV *rv, const char *classname)
dVAR;
SV *sv;
+ PERL_ARGS_ASSERT_NEWSVRV;
+
new_SV(sv);
SV_CHECK_THINKFIRST_COW_DROP(rv);
@@ -8040,6 +8225,9 @@ SV*
Perl_sv_setref_pv(pTHX_ SV *rv, const char *classname, void *pv)
{
dVAR;
+
+ PERL_ARGS_ASSERT_SV_SETREF_PV;
+
if (!pv) {
sv_setsv(rv, &PL_sv_undef);
SvSETMAGIC(rv);
@@ -8064,6 +8252,8 @@ will have a reference count of 1, and the RV will be returned.
SV*
Perl_sv_setref_iv(pTHX_ SV *rv, const char *classname, IV iv)
{
+ PERL_ARGS_ASSERT_SV_SETREF_IV;
+
sv_setiv(newSVrv(rv,classname), iv);
return rv;
}
@@ -8083,6 +8273,8 @@ will have a reference count of 1, and the RV will be returned.
SV*
Perl_sv_setref_uv(pTHX_ SV *rv, const char *classname, UV uv)
{
+ PERL_ARGS_ASSERT_SV_SETREF_UV;
+
sv_setuv(newSVrv(rv,classname), uv);
return rv;
}
@@ -8102,6 +8294,8 @@ will have a reference count of 1, and the RV will be returned.
SV*
Perl_sv_setref_nv(pTHX_ SV *rv, const char *classname, NV nv)
{
+ PERL_ARGS_ASSERT_SV_SETREF_NV;
+
sv_setnv(newSVrv(rv,classname), nv);
return rv;
}
@@ -8124,6 +8318,8 @@ Note that C<sv_setref_pv> copies the pointer while this copies the string.
SV*
Perl_sv_setref_pvn(pTHX_ SV *rv, const char *classname, const char *pv, STRLEN n)
{
+ PERL_ARGS_ASSERT_SV_SETREF_PVN;
+
sv_setpvn(newSVrv(rv,classname), pv, n);
return rv;
}
@@ -8143,6 +8339,9 @@ Perl_sv_bless(pTHX_ SV *sv, HV *stash)
{
dVAR;
SV *tmpRef;
+
+ PERL_ARGS_ASSERT_SV_BLESS;
+
if (!SvROK(sv))
Perl_croak(aTHX_ "Can't bless non-reference value");
tmpRef = SvRV(sv);
@@ -8188,6 +8387,8 @@ S_sv_unglob(pTHX_ SV *sv)
HV *stash;
SV * const temp = sv_newmortal();
+ PERL_ARGS_ASSERT_SV_UNGLOB;
+
assert(SvTYPE(sv) == SVt_PVGV);
SvFAKE_off(sv);
gv_efullname3(temp, (GV *) sv, "*");
@@ -8240,6 +8441,8 @@ Perl_sv_unref_flags(pTHX_ SV *ref, U32 flags)
{
SV* const target = SvRV(ref);
+ PERL_ARGS_ASSERT_SV_UNREF_FLAGS;
+
if (SvWEAKREF(ref)) {
sv_del_backref(target, ref);
SvWEAKREF_off(ref);
@@ -8266,6 +8469,8 @@ Untaint an SV. Use C<SvTAINTED_off> instead.
void
Perl_sv_untaint(pTHX_ SV *sv)
{
+ PERL_ARGS_ASSERT_SV_UNTAINT;
+
if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv)) {
MAGIC * const mg = mg_find(sv, PERL_MAGIC_taint);
if (mg)
@@ -8283,6 +8488,8 @@ Test an SV for taintedness. Use C<SvTAINTED> instead.
bool
Perl_sv_tainted(pTHX_ SV *sv)
{
+ PERL_ARGS_ASSERT_SV_TAINTED;
+
if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv)) {
const MAGIC * const mg = mg_find(sv, PERL_MAGIC_taint);
if (mg && (mg->mg_len & 1) )
@@ -8307,6 +8514,8 @@ Perl_sv_setpviv(pTHX_ SV *sv, IV iv)
char *ebuf;
char * const ptr = uiv_2buf(buf, iv, 0, 0, &ebuf);
+ PERL_ARGS_ASSERT_SV_SETPVIV;
+
sv_setpvn(sv, ptr, ebuf - ptr);
}
@@ -8321,6 +8530,8 @@ Like C<sv_setpviv>, but also handles 'set' magic.
void
Perl_sv_setpviv_mg(pTHX_ SV *sv, IV iv)
{
+ PERL_ARGS_ASSERT_SV_SETPVIV_MG;
+
sv_setpviv(sv, iv);
SvSETMAGIC(sv);
}
@@ -8337,6 +8548,9 @@ Perl_sv_setpvf_nocontext(SV *sv, const char* pat, ...)
{
dTHX;
va_list args;
+
+ PERL_ARGS_ASSERT_SV_SETPVF_NOCONTEXT;
+
va_start(args, pat);
sv_vsetpvf(sv, pat, &args);
va_end(args);
@@ -8352,6 +8566,9 @@ Perl_sv_setpvf_mg_nocontext(SV *sv, const char* pat, ...)
{
dTHX;
va_list args;
+
+ PERL_ARGS_ASSERT_SV_SETPVF_MG_NOCONTEXT;
+
va_start(args, pat);
sv_vsetpvf_mg(sv, pat, &args);
va_end(args);
@@ -8371,6 +8588,9 @@ void
Perl_sv_setpvf(pTHX_ SV *sv, const char* pat, ...)
{
va_list args;
+
+ PERL_ARGS_ASSERT_SV_SETPVF;
+
va_start(args, pat);
sv_vsetpvf(sv, pat, &args);
va_end(args);
@@ -8390,6 +8610,8 @@ Usually used via its frontend C<sv_setpvf>.
void
Perl_sv_vsetpvf(pTHX_ SV *sv, const char* pat, va_list* args)
{
+ PERL_ARGS_ASSERT_SV_VSETPVF;
+
sv_vsetpvfn(sv, pat, strlen(pat), args, NULL, 0, NULL);
}
@@ -8405,6 +8627,9 @@ void
Perl_sv_setpvf_mg(pTHX_ SV *sv, const char* pat, ...)
{
va_list args;
+
+ PERL_ARGS_ASSERT_SV_SETPVF_MG;
+
va_start(args, pat);
sv_vsetpvf_mg(sv, pat, &args);
va_end(args);
@@ -8423,6 +8648,8 @@ Usually used via its frontend C<sv_setpvf_mg>.
void
Perl_sv_vsetpvf_mg(pTHX_ SV *sv, const char* pat, va_list* args)
{
+ PERL_ARGS_ASSERT_SV_VSETPVF_MG;
+
sv_vsetpvfn(sv, pat, strlen(pat), args, NULL, 0, NULL);
SvSETMAGIC(sv);
}
@@ -8439,6 +8666,9 @@ Perl_sv_catpvf_nocontext(SV *sv, const char* pat, ...)
{
dTHX;
va_list args;
+
+ PERL_ARGS_ASSERT_SV_CATPVF_NOCONTEXT;
+
va_start(args, pat);
sv_vcatpvf(sv, pat, &args);
va_end(args);
@@ -8454,6 +8684,9 @@ Perl_sv_catpvf_mg_nocontext(SV *sv, const char* pat, ...)
{
dTHX;
va_list args;
+
+ PERL_ARGS_ASSERT_SV_CATPVF_MG_NOCONTEXT;
+
va_start(args, pat);
sv_vcatpvf_mg(sv, pat, &args);
va_end(args);
@@ -8477,6 +8710,9 @@ void
Perl_sv_catpvf(pTHX_ SV *sv, const char* pat, ...)
{
va_list args;
+
+ PERL_ARGS_ASSERT_SV_CATPVF;
+
va_start(args, pat);
sv_vcatpvf(sv, pat, &args);
va_end(args);
@@ -8496,6 +8732,8 @@ Usually used via its frontend C<sv_catpvf>.
void
Perl_sv_vcatpvf(pTHX_ SV *sv, const char* pat, va_list* args)
{
+ PERL_ARGS_ASSERT_SV_VCATPVF;
+
sv_vcatpvfn(sv, pat, strlen(pat), args, NULL, 0, NULL);
}
@@ -8511,6 +8749,9 @@ void
Perl_sv_catpvf_mg(pTHX_ SV *sv, const char* pat, ...)
{
va_list args;
+
+ PERL_ARGS_ASSERT_SV_CATPVF_MG;
+
va_start(args, pat);
sv_vcatpvf_mg(sv, pat, &args);
va_end(args);
@@ -8529,6 +8770,8 @@ Usually used via its frontend C<sv_catpvf_mg>.
void
Perl_sv_vcatpvf_mg(pTHX_ SV *sv, const char* pat, va_list* args)
{
+ PERL_ARGS_ASSERT_SV_VCATPVF_MG;
+
sv_vcatpvfn(sv, pat, strlen(pat), args, NULL, 0, NULL);
SvSETMAGIC(sv);
}
@@ -8547,6 +8790,8 @@ Usually used via one of its frontends C<sv_vsetpvf> and C<sv_vsetpvf_mg>.
void
Perl_sv_vsetpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV **svargs, I32 svmax, bool *maybe_tainted)
{
+ PERL_ARGS_ASSERT_SV_VSETPVFN;
+
sv_setpvn(sv, "", 0);
sv_vcatpvfn(sv, pat, patlen, args, svargs, svmax, maybe_tainted);
}
@@ -8556,6 +8801,9 @@ S_expect_number(pTHX_ char** pattern)
{
dVAR;
I32 var = 0;
+
+ PERL_ARGS_ASSERT_EXPECT_NUMBER;
+
switch (**pattern) {
case '1': case '2': case '3':
case '4': case '5': case '6':
@@ -8577,6 +8825,8 @@ S_F0convert(NV nv, char *endbuf, STRLEN *len)
const int neg = nv < 0;
UV uv;
+ PERL_ARGS_ASSERT_F0CONVERT;
+
if (neg)
nv = -nv;
if (nv < UV_MAX) {
@@ -8640,6 +8890,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
/* large enough for "%#.#f" --chip */
/* what about long double NVs? --jhi */
+ PERL_ARGS_ASSERT_SV_VCATPVFN;
PERL_UNUSED_ARG(maybe_tainted);
/* no matter what, this is a string now */
@@ -9732,6 +9983,8 @@ Perl_parser_dup(pTHX_ const yy_parser *proto, CLONE_PARAMS* param)
{
yy_parser *parser;
+ PERL_ARGS_ASSERT_PARSER_DUP;
+
if (!proto)
return NULL;
@@ -9849,6 +10102,7 @@ Perl_fp_dup(pTHX_ PerlIO *fp, char type, CLONE_PARAMS *param)
{
PerlIO *ret;
+ PERL_ARGS_ASSERT_FP_DUP;
PERL_UNUSED_ARG(type);
if (!fp)
@@ -9884,6 +10138,8 @@ Perl_gp_dup(pTHX_ GP *gp, CLONE_PARAMS* param)
{
GP *ret;
+ PERL_ARGS_ASSERT_GP_DUP;
+
if (!gp)
return (GP*)NULL;
/* look for it in the table first */
@@ -9917,6 +10173,9 @@ Perl_mg_dup(pTHX_ MAGIC *mg, CLONE_PARAMS* param)
{
MAGIC *mgprev = (MAGIC*)NULL;
MAGIC *mgret;
+
+ PERL_ARGS_ASSERT_MG_DUP;
+
if (!mg)
return (MAGIC*)NULL;
/* look for it in the table first */
@@ -10009,10 +10268,13 @@ Perl_ptr_table_new(pTHX)
/* map an existing pointer using a table */
STATIC PTR_TBL_ENT_t *
-S_ptr_table_find(PTR_TBL_t *tbl, const void *sv) {
+S_ptr_table_find(PTR_TBL_t *tbl, const void *sv)
+{
PTR_TBL_ENT_t *tblent;
const UV hash = PTR_TABLE_HASH(sv);
- assert(tbl);
+
+ PERL_ARGS_ASSERT_PTR_TABLE_FIND;
+
tblent = tbl->tbl_ary[hash & tbl->tbl_max];
for (; tblent; tblent = tblent->next) {
if (tblent->oldval == sv)
@@ -10025,7 +10287,10 @@ void *
Perl_ptr_table_fetch(pTHX_ PTR_TBL_t *tbl, const void *sv)
{
PTR_TBL_ENT_t const *const tblent = ptr_table_find(tbl, sv);
+
+ PERL_ARGS_ASSERT_PTR_TABLE_FETCH;
PERL_UNUSED_CONTEXT;
+
return tblent ? tblent->newval : NULL;
}
@@ -10035,6 +10300,8 @@ void
Perl_ptr_table_store(pTHX_ PTR_TBL_t *tbl, const void *oldsv, void *newsv)
{
PTR_TBL_ENT_t *tblent = ptr_table_find(tbl, oldsv);
+
+ PERL_ARGS_ASSERT_PTR_TABLE_STORE;
PERL_UNUSED_CONTEXT;
if (tblent) {
@@ -10063,6 +10330,8 @@ Perl_ptr_table_split(pTHX_ PTR_TBL_t *tbl)
const UV oldsize = tbl->tbl_max + 1;
UV newsize = oldsize * 2;
UV i;
+
+ PERL_ARGS_ASSERT_PTR_TABLE_SPLIT;
PERL_UNUSED_CONTEXT;
Renew(ary, newsize, PTR_TBL_ENT_t*);
@@ -10128,6 +10397,8 @@ Perl_ptr_table_free(pTHX_ PTR_TBL_t *tbl)
void
Perl_rvpv_dup(pTHX_ SV *dstr, const SV *sstr, CLONE_PARAMS* param)
{
+ PERL_ARGS_ASSERT_RVPV_DUP;
+
if (SvROK(sstr)) {
SvRV_set(dstr, SvWEAKREF(sstr)
? sv_dup(SvRV(sstr), param)
@@ -10177,6 +10448,8 @@ Perl_sv_dup(pTHX_ const SV *sstr, CLONE_PARAMS* param)
dVAR;
SV *dstr;
+ PERL_ARGS_ASSERT_SV_DUP;
+
if (!sstr)
return NULL;
if (SvTYPE(sstr) == SVTYPEMASK) {
@@ -10505,6 +10778,8 @@ Perl_cx_dup(pTHX_ PERL_CONTEXT *cxs, I32 ix, I32 max, CLONE_PARAMS* param)
{
PERL_CONTEXT *ncxs;
+ PERL_ARGS_ASSERT_CX_DUP;
+
if (!cxs)
return (PERL_CONTEXT*)NULL;
@@ -10589,6 +10864,8 @@ Perl_si_dup(pTHX_ PERL_SI *si, CLONE_PARAMS* param)
{
PERL_SI *nsi;
+ PERL_ARGS_ASSERT_SI_DUP;
+
if (!si)
return (PERL_SI*)NULL;
@@ -10642,6 +10919,8 @@ Perl_any_dup(pTHX_ void *v, const PerlInterpreter *proto_perl)
{
void *ret;
+ PERL_ARGS_ASSERT_ANY_DUP;
+
if (!v)
return (void*)NULL;
@@ -10684,6 +10963,8 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl, CLONE_PARAMS* param)
void (*dptr) (void*);
void (*dxptr) (pTHX_ void*);
+ PERL_ARGS_ASSERT_SS_DUP;
+
Newxz(nss, max, ANY);
while (ix > 0) {
@@ -11055,6 +11336,8 @@ perl_clone(PerlInterpreter *proto_perl, UV flags)
dVAR;
#ifdef PERL_IMPLICIT_SYS
+ PERL_ARGS_ASSERT_PERL_CLONE;
+
/* perlhost.h so we need to call into it
to clone the host, CPerlHost should have a c interface, sky */
@@ -11090,6 +11373,9 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
CLONE_PARAMS* const param = &clone_params;
PerlInterpreter * const my_perl = (PerlInterpreter*)(*ipM->pMalloc)(ipM, sizeof(PerlInterpreter));
+
+ PERL_ARGS_ASSERT_PERL_CLONE_USING;
+
/* for each stash, determine whether its objects should be cloned */
S_visit(proto_perl, do_mark_cloneable_stash, SVt_PVHV, SVTYPEMASK);
PERL_SET_THX(my_perl);
@@ -11125,6 +11411,9 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
CLONE_PARAMS clone_params;
CLONE_PARAMS* param = &clone_params;
PerlInterpreter * const my_perl = (PerlInterpreter*)PerlMem_malloc(sizeof(PerlInterpreter));
+
+ PERL_ARGS_ASSERT_PERL_CLONE;
+
/* for each stash, determine whether its objects should be cloned */
S_visit(proto_perl, do_mark_cloneable_stash, SVt_PVHV, SVTYPEMASK);
PERL_SET_THX(my_perl);
@@ -11769,6 +12058,9 @@ char *
Perl_sv_recode_to_utf8(pTHX_ SV *sv, SV *encoding)
{
dVAR;
+
+ PERL_ARGS_ASSERT_SV_RECODE_TO_UTF8;
+
if (SvPOK(sv) && !SvUTF8(sv) && !IN_BYTES && SvROK(encoding)) {
SV *uni;
STRLEN len;
@@ -11831,6 +12123,9 @@ Perl_sv_cat_decode(pTHX_ SV *dsv, SV *encoding,
{
dVAR;
bool ret = FALSE;
+
+ PERL_ARGS_ASSERT_SV_CAT_DECODE;
+
if (SvPOK(ssv) && SvPOK(dsv) && SvROK(encoding) && offset) {
SV *offsv;
dSP;
@@ -11880,6 +12175,8 @@ S_find_hash_subscript(pTHX_ HV *hv, SV* val)
register HE **array;
I32 i;
+ PERL_ARGS_ASSERT_FIND_HASH_SUBSCRIPT;
+
if (!hv || SvMAGICAL(hv) || !HvARRAY(hv) ||
(HvTOTALKEYS(hv) > FUV_MAX_SEARCH_SIZE))
return NULL;
@@ -11911,6 +12208,9 @@ STATIC I32
S_find_array_subscript(pTHX_ AV *av, SV* val)
{
dVAR;
+
+ PERL_ARGS_ASSERT_FIND_ARRAY_SUBSCRIPT;
+
if (!av || SvMAGICAL(av) || !AvARRAY(av) ||
(AvFILLp(av) > FUV_MAX_SEARCH_SIZE))
return -1;