Skip to content

Commit 801f8b8

Browse files
committed
Add some ARGS_ASSERT calls
An ARGS_ASSERT macro is always generated for every function listed in embed.fnc, unless possibly suppressed with the G flag for that entry. The generated macro is empty if there is nothing to assert. It is mandatory (enforced through a porting test) to call that macro when non-empty. (Hopefully the call occurs in the function the macro is designed for, but the porting test is currently simplistic and doesn't check for that; often compilation would fail anyway if it did get placed in the wrong function, as the parameter names the macro expects and the ones in the function could easily not match). It is optional (but a good idea) to call the macro even when empty. That way this commit would not have been necessary. From time to time, an empty macro becomes non-empty as we figure out more things to check for. When that happens, the porting test fails for the newly-non-empty macros that aren't called. If the function had originally called the empty-one, its source wouldn't have to change at all. Several commits from now will make some ARGS_ASSERT macros non-empty; this commit adds calls to the ones that weren't already called.
1 parent 4e7803f commit 801f8b8

File tree

5 files changed

+19
-0
lines changed

5 files changed

+19
-0
lines changed

dump.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2933,12 +2933,14 @@ Perl_sv_dump_depth(pTHX_ SV *sv, I32 depth)
29332933
void
29342934
Perl_av_dump(pTHX_ AV *av)
29352935
{
2936+
PERL_ARGS_ASSERT_AV_DUMP;
29362937
sv_dump_depth((SV*)av, 3);
29372938
}
29382939

29392940
void
29402941
Perl_hv_dump(pTHX_ HV *hv)
29412942
{
2943+
PERL_ARGS_ASSERT_HV_DUMP;
29422944
sv_dump_depth((SV*)hv, 3);
29432945
}
29442946

gv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3340,6 +3340,8 @@ Implements C<StashHANDLER>, which you should use instead
33403340
CV*
33413341
Perl_gv_handler(pTHX_ HV *stash, I32 id)
33423342
{
3343+
PERL_ARGS_ASSERT_GV_HANDLER;
3344+
33433345
MAGIC *mg;
33443346
AMT *amtp;
33453347
U32 newgen;

hv.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,6 +1836,8 @@ returned.
18361836
HV *
18371837
Perl_newHVhv(pTHX_ HV *ohv)
18381838
{
1839+
PERL_ARGS_ASSERT_NEWHVHV;
1840+
18391841
HV * const hv = newHV();
18401842
STRLEN hv_max;
18411843

@@ -1944,6 +1946,8 @@ added to it. A pointer to the new hash is returned.
19441946
HV *
19451947
Perl_hv_copy_hints_hv(pTHX_ HV *const ohv)
19461948
{
1949+
PERL_ARGS_ASSERT_HV_COPY_HINTS_HV;
1950+
19471951
HV * const hv = newHV();
19481952

19491953
if (ohv) {
@@ -2009,6 +2013,7 @@ S_hv_free_ent_ret(pTHX_ HE *entry)
20092013
void
20102014
Perl_hv_free_ent(pTHX_ HV *notused, HE *entry)
20112015
{
2016+
PERL_ARGS_ASSERT_HV_FREE_ENT;
20122017
PERL_UNUSED_ARG(notused);
20132018

20142019
if (!entry)
@@ -2022,6 +2027,7 @@ Perl_hv_free_ent(pTHX_ HV *notused, HE *entry)
20222027
void
20232028
Perl_hv_delayfree_ent(pTHX_ HV *notused, HE *entry)
20242029
{
2030+
PERL_ARGS_ASSERT_HV_DELAYFREE_ENT;
20252031
PERL_UNUSED_ARG(notused);
20262032

20272033
if (!entry)
@@ -2049,6 +2055,8 @@ return.
20492055
void
20502056
Perl_hv_clear(pTHX_ HV *hv)
20512057
{
2058+
PERL_ARGS_ASSERT_HV_CLEAR;
2059+
20522060
SSize_t orig_ix;
20532061

20542062
if (!hv)
@@ -2279,6 +2287,8 @@ return.
22792287
void
22802288
Perl_hv_undef_flags(pTHX_ HV *hv, U32 flags)
22812289
{
2290+
PERL_ARGS_ASSERT_HV_UNDEF_FLAGS;
2291+
22822292
bool save;
22832293
SSize_t orig_ix = PL_tmps_ix; /* silence compiler warning about uninitialized vars */
22842294

op.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11781,6 +11781,7 @@ S_process_special_blocks(pTHX_ I32 floor, const char *const fullname,
1178111781
CV *
1178211782
Perl_newCONSTSUB(pTHX_ HV *stash, const char *name, SV *sv)
1178311783
{
11784+
PERL_ARGS_ASSERT_NEWCONSTSUB;
1178411785
return newCONSTSUB_flags(stash, name, name ? strlen(name) : 0, 0, sv);
1178511786
}
1178611787

@@ -11865,6 +11866,8 @@ CV *
1186511866
Perl_newCONSTSUB_flags(pTHX_ HV *stash, const char *name, STRLEN len,
1186611867
U32 flags, SV *sv)
1186711868
{
11869+
PERL_ARGS_ASSERT_NEWCONSTSUB_FLAGS;
11870+
1186811871
CV* cv;
1186911872
const char *const file = CopFILE(PL_curcop);
1187011873

pad.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,8 @@ finished its job, so it can forget the slab.
507507
void
508508
Perl_cv_forget_slab(pTHX_ CV *cv)
509509
{
510+
PERL_ARGS_ASSERT_CV_FORGET_SLAB;
511+
510512
bool slabbed;
511513
OPSLAB *slab = NULL;
512514

0 commit comments

Comments
 (0)