Remove customized ARGS_ASSERT macros

These existed because they exceeded the rudimentary capabilities of the
generated ARGS_ASSERT macros.  But the previous commit generalized that
capability, so they can change to use that.

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 the macro getting updated.  This new
scheme will prevent that from happening in the future.
This commit is contained in:
Karl Williamson 2025-08-02 14:41:27 -06:00
parent 14d0846839
commit faa4724a28
4 changed files with 23 additions and 26 deletions

View File

@ -4537,11 +4537,12 @@ op |void |sv_add_backref |NN SV * const tsv \
|NN SV * const sv
#endif
#if defined(PERL_IN_GV_C) || defined(PERL_IN_UNIVERSAL_C)
EGdp |HV * |gv_stashsvpvn_cached \
|SV *namesv \
|const char *name \
Edp |HV * |gv_stashsvpvn_cached \
|NULLOK SV *namesv \
|NULLOK const char *name \
|U32 namelen \
|I32 flags
|I32 flags \
assert(namesv || name)
#endif
#if defined(PERL_IN_HV_C)
Sx |void |clear_placeholders \
@ -6120,17 +6121,19 @@ S |I32 |utf16_textfilter \
# endif
#endif /* defined(PERL_IN_TOKE_C) */
#if defined(PERL_IN_UNIVERSAL_C)
GS |bool |isa_lookup |NULLOK NOCHECK HV *stash \
S |bool |isa_lookup |NN HV *stash \
|NULLOK SV *namesv \
|NULLOK const char *name \
|STRLEN len \
|U32 flags
GS |bool |sv_derived_from_svpvn \
|NULLOK SV *sv \
|U32 flags \
assert(namesv || name)
S |bool |sv_derived_from_svpvn \
|NN SV *sv \
|NULLOK SV *namesv \
|NULLOK const char *name \
|const STRLEN len \
|U32 flags
|U32 flags \
assert(namesv || name)
#endif
#if defined(PERL_IN_UTF8_C)
RS |UV |check_locale_boundary_crossing \

7
gv.c
View File

@ -1691,17 +1691,14 @@ reasons.
=cut
*/
#define PERL_ARGS_ASSERT_GV_STASHSVPVN_CACHED \
assert(namesv || name)
HV*
Perl_gv_stashsvpvn_cached(pTHX_ SV *namesv, const char *name, U32 namelen, I32 flags)
{
PERL_ARGS_ASSERT_GV_STASHSVPVN_CACHED;
HV* stash;
HE* he;
PERL_ARGS_ASSERT_GV_STASHSVPVN_CACHED;
he = (HE *)hv_common(
PL_stashcache, namesv, name, namelen,
(flags & SVf_UTF8) ? HVhek_UTF8 : 0, 0, NULL, 0

8
proto.h generated
View File

@ -6950,6 +6950,8 @@ Perl_sv_add_backref(pTHX_ SV * const tsv, SV * const sv)
PERL_CALLCONV HV *
Perl_gv_stashsvpvn_cached(pTHX_ SV *namesv, const char *name, U32 namelen, I32 flags)
__attribute__visibility__("hidden");
# define PERL_ARGS_ASSERT_GV_STASHSVPVN_CACHED \
assert(namesv || name)
#endif
#if defined(PERL_IN_HV_C)
@ -9470,11 +9472,15 @@ S_utf16_textfilter(pTHX_ int idx, SV *sv, int maxlen);
#if defined(PERL_IN_UNIVERSAL_C)
STATIC bool
S_isa_lookup(pTHX_ HV *stash, SV *namesv, const char *name, STRLEN len, U32 flags);
# define PERL_ARGS_ASSERT_ISA_LOOKUP \
assert(stash); assert(SvTYPE(stash) == SVt_PVHV); assert(namesv || name)
STATIC bool
S_sv_derived_from_svpvn(pTHX_ SV *sv, SV *namesv, const char *name, const STRLEN len, U32 flags);
# define PERL_ARGS_ASSERT_SV_DERIVED_FROM_SVPVN \
assert(sv); assert(namesv || name)
#endif
#endif /* defined(PERL_IN_UNIVERSAL_C) */
#if defined(PERL_IN_UTF8_C)
STATIC UV
S__to_utf8_case(pTHX_ const UV original, const U8 *p, U8 *ustrp, STRLEN *lenp, SV *invlist, const I32 * const invmap, const U32 * const * const aux_tables, const U8 * const aux_table_lengths, const char * const normal);

View File

@ -39,20 +39,15 @@
* The main guts of traverse_isa was actually copied from gv_fetchmeth
*/
#define PERL_ARGS_ASSERT_ISA_LOOKUP \
assert(stash); \
assert(namesv || name)
STATIC bool
S_isa_lookup(pTHX_ HV *stash, SV *namesv, const char * name, STRLEN len, U32 flags)
{
PERL_ARGS_ASSERT_ISA_LOOKUP;
const struct mro_meta *const meta = HvMROMETA(stash);
HV *isa = meta->isa;
const HV *our_stash;
PERL_ARGS_ASSERT_ISA_LOOKUP;
if (!isa) {
(void)mro_get_linear_isa(stash);
isa = meta->isa;
@ -83,10 +78,6 @@ S_isa_lookup(pTHX_ HV *stash, SV *namesv, const char * name, STRLEN len, U32 fla
return FALSE;
}
#define PERL_ARGS_ASSERT_SV_DERIVED_FROM_SVPVN \
assert(sv); \
assert(namesv || name)
STATIC bool
S_sv_derived_from_svpvn(pTHX_ SV *sv, SV *namesv, const char * name, const STRLEN len, U32 flags)
{