This should have been written this way to begin with (I'm the culprit).
But we should have a method so another routine doesn't have to know the
internal details.
|bool passed_in_invlist_has_user_defined_property
EXMpR |SV* |_invlist_contents|NN SV* const invlist
EXMpR |bool |_is_swash_user_defined|NN SV* const swash
+EXMpR |SV* |_get_swash_invlist|NN SV* const swash
#endif
Ap |void |taint_env
Ap |void |taint_proper |NULLOK const char* f|NN const char *const s
# endif
# if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_UTF8_C)
#define _core_swash_init(a,b,c,d,e,f,g,h) Perl__core_swash_init(aTHX_ a,b,c,d,e,f,g,h)
+#define _get_swash_invlist(a) Perl__get_swash_invlist(aTHX_ a)
#define _invlist_contents(a) Perl__invlist_contents(aTHX_ a)
#define _is_swash_user_defined(a) Perl__is_swash_user_defined(aTHX_ a)
# endif
#define PERL_ARGS_ASSERT__CORE_SWASH_INIT \
assert(pkg); assert(name); assert(listsv)
+PERL_CALLCONV SV* Perl__get_swash_invlist(pTHX_ SV* const swash)
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT__GET_SWASH_INVLIST \
+ assert(swash)
+
PERL_CALLCONV SV* Perl__invlist_contents(pTHX_ SV* const invlist)
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
n = 1;
}
if (!SIZE_ONLY) {
- SV** invlistsvp;
SV* invlist;
char* name;
if ( ! swash
|| ! SvROK(swash)
|| ! SvTYPE(SvRV(swash)) == SVt_PVHV
- || ! (invlistsvp =
- hv_fetchs(MUTABLE_HV(SvRV(swash)),
- "INVLIST", FALSE))
- || ! (invlist = *invlistsvp))
+ || ! (invlist = _get_swash_invlist(swash)))
{
if (swash) {
SvREFCNT_dec(swash);
if (! PL_utf8_foldable) {
SV* swash = swash_init("utf8", "_Perl_Any_Folds",
&PL_sv_undef, 1, 0);
- PL_utf8_foldable = _swash_to_invlist(swash);
+ PL_utf8_foldable = _get_swash_invlist(swash);
SvREFCNT_dec(swash);
}
return cBOOL(SvUV(*ptr));
}
+SV*
+Perl__get_swash_invlist(pTHX_ SV* const swash)
+{
+ SV** ptr = hv_fetchs(MUTABLE_HV(SvRV(swash)), "INVLIST", FALSE);
+
+ PERL_ARGS_ASSERT__GET_SWASH_INVLIST;
+
+ if (! ptr) {
+ return NULL;
+ }
+
+ return *ptr;
+}
+
/*
=for apidoc uvchr_to_utf8