Skip to content

Commit dafc64f

Browse files
committed
Remove customized ARGS_ASSERT macros
These existed because the rudimentary ability to generate ARGS_ASSERT macros was generalized in the previous commit. This moves the three extant customized macros to use the new facility, removing the need for overriding things The customized PERL_ARGS_ASSERT_ISA_LOOKUP was out-of-date, missing an assertion that got added, without it getting updated. This new scheme will prevent that from happening in the future.
1 parent 402e7c1 commit dafc64f

File tree

4 files changed

+25
-28
lines changed

4 files changed

+25
-28
lines changed

embed.fnc

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4521,11 +4521,12 @@ op |void |sv_add_backref |NN SV * const tsv \
45214521
|NN SV * const sv
45224522
#endif
45234523
#if defined(PERL_IN_GV_C) || defined(PERL_IN_UNIVERSAL_C)
4524-
EGdp |HV * |gv_stashsvpvn_cached \
4525-
|SV *namesv \
4526-
|const char *name \
4524+
Edp |HV * |gv_stashsvpvn_cached \
4525+
|NULLOK SV *namesv \
4526+
|NULLOK const char *name \
45274527
|U32 namelen \
4528-
|I32 flags
4528+
|I32 flags \
4529+
assert(namesv || name)
45294530
#endif
45304531
#if defined(PERL_IN_HV_C)
45314532
Sx |void |clear_placeholders \
@@ -6104,17 +6105,19 @@ S |I32 |utf16_textfilter \
61046105
# endif
61056106
#endif /* defined(PERL_IN_TOKE_C) */
61066107
#if defined(PERL_IN_UNIVERSAL_C)
6107-
GS |bool |isa_lookup |NULLOK NOCHECK HV *stash \
6108+
S |bool |isa_lookup |NN HV *stash \
61086109
|NULLOK SV *namesv \
61096110
|NULLOK const char *name \
61106111
|STRLEN len \
6111-
|U32 flags
6112-
GS |bool |sv_derived_from_svpvn \
6112+
|U32 flags \
6113+
assert(namesv || name)
6114+
S |bool |sv_derived_from_svpvn \
61136115
|NULLOK SV *sv \
61146116
|NULLOK SV *namesv \
61156117
|NULLOK const char *name \
61166118
|const STRLEN len \
6117-
|U32 flags
6119+
|U32 flags \
6120+
assert(namesv || name)
61186121
#endif
61196122
#if defined(PERL_IN_UTF8_C)
61206123
RS |UV |check_locale_boundary_crossing \

gv.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,17 +1691,14 @@ reasons.
16911691
=cut
16921692
*/
16931693

1694-
#define PERL_ARGS_ASSERT_GV_STASHSVPVN_CACHED \
1695-
assert(namesv || name)
1696-
16971694
HV*
16981695
Perl_gv_stashsvpvn_cached(pTHX_ SV *namesv, const char *name, U32 namelen, I32 flags)
16991696
{
1697+
PERL_ARGS_ASSERT_GV_STASHSVPVN_CACHED;
1698+
17001699
HV* stash;
17011700
HE* he;
17021701

1703-
PERL_ARGS_ASSERT_GV_STASHSVPVN_CACHED;
1704-
17051702
he = (HE *)hv_common(
17061703
PL_stashcache, namesv, name, namelen,
17071704
(flags & SVf_UTF8) ? HVhek_UTF8 : 0, 0, NULL, 0

proto.h

Lines changed: 10 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

universal.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,15 @@
3939
* The main guts of traverse_isa was actually copied from gv_fetchmeth
4040
*/
4141

42-
#define PERL_ARGS_ASSERT_ISA_LOOKUP \
43-
assert(stash); \
44-
assert(namesv || name)
45-
46-
4742
STATIC bool
4843
S_isa_lookup(pTHX_ HV *stash, SV *namesv, const char * name, STRLEN len, U32 flags)
4944
{
45+
PERL_ARGS_ASSERT_ISA_LOOKUP;
46+
5047
const struct mro_meta *const meta = HvMROMETA(stash);
5148
HV *isa = meta->isa;
5249
const HV *our_stash;
5350

54-
PERL_ARGS_ASSERT_ISA_LOOKUP;
55-
5651
if (!isa) {
5752
(void)mro_get_linear_isa(stash);
5853
isa = meta->isa;
@@ -83,10 +78,6 @@ S_isa_lookup(pTHX_ HV *stash, SV *namesv, const char * name, STRLEN len, U32 fla
8378
return FALSE;
8479
}
8580

86-
#define PERL_ARGS_ASSERT_SV_DERIVED_FROM_SVPVN \
87-
assert(sv); \
88-
assert(namesv || name)
89-
9081
STATIC bool
9182
S_sv_derived_from_svpvn(pTHX_ SV *sv, SV *namesv, const char * name, const STRLEN len, U32 flags)
9283
{

0 commit comments

Comments
 (0)