Skip to content

Commit 81cfcbb

Browse files
committed
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.
1 parent 2a3039a commit 81cfcbb

File tree

4 files changed

+23
-26
lines changed

4 files changed

+23
-26
lines changed

embed.fnc

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4534,11 +4534,12 @@ op |void |sv_add_backref |NN SV * const tsv \
45344534
|NN SV * const sv
45354535
#endif
45364536
#if defined(PERL_IN_GV_C) || defined(PERL_IN_UNIVERSAL_C)
4537-
EGdp |HV * |gv_stashsvpvn_cached \
4538-
|SV *namesv \
4539-
|const char *name \
4537+
Edp |HV * |gv_stashsvpvn_cached \
4538+
|NULLOK SV *namesv \
4539+
|NULLOK const char *name \
45404540
|U32 namelen \
4541-
|I32 flags
4541+
|I32 flags \
4542+
assert(namesv || name)
45424543
#endif
45434544
#if defined(PERL_IN_HV_C)
45444545
Sx |void |clear_placeholders \
@@ -6117,17 +6118,19 @@ S |I32 |utf16_textfilter \
61176118
# endif
61186119
#endif /* defined(PERL_IN_TOKE_C) */
61196120
#if defined(PERL_IN_UNIVERSAL_C)
6120-
GS |bool |isa_lookup |NULLOK NOCHECK HV *stash \
6121+
S |bool |isa_lookup |NN HV *stash \
61216122
|NULLOK SV *namesv \
61226123
|NULLOK const char *name \
61236124
|STRLEN len \
6124-
|U32 flags
6125-
GS |bool |sv_derived_from_svpvn \
6126-
|NULLOK SV *sv \
6125+
|U32 flags \
6126+
assert(namesv || name)
6127+
S |bool |sv_derived_from_svpvn \
6128+
|NN SV *sv \
61276129
|NULLOK SV *namesv \
61286130
|NULLOK const char *name \
61296131
|const STRLEN len \
6130-
|U32 flags
6132+
|U32 flags \
6133+
assert(namesv || name)
61316134
#endif
61326135
#if defined(PERL_IN_UTF8_C)
61336136
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: 7 additions & 1 deletion
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)