NULL, /* No inversion list */
&swash_init_flags
);
- if ( ! swash
- || ! SvROK(swash)
- || ! SvTYPE(SvRV(swash)) == SVt_PVHV
- || ! (invlist = _get_swash_invlist(swash)))
- {
+ if (! swash || ! (invlist = _get_swash_invlist(swash))) {
if (swash) {
SvREFCNT_dec(swash);
swash = NULL;
if (listsvp) {
SV* matches_string = newSVpvn("", 0);
- SV** invlistsvp;
/* Use the swash, if any, which has to have incorporated into it all
* possibilities */
- if ( sw
- && SvROK(sw)
- && SvTYPE(SvRV(sw)) == SVt_PVHV
- && (invlistsvp = hv_fetchs(MUTABLE_HV(SvRV(sw)), "INVLIST", FALSE)))
- {
- invlist = *invlistsvp;
- }
- else if (si && si != &PL_sv_undef) {
+ if ((! sw || (invlist = _get_swash_invlist(sw)) == NULL)
+ && (si && si != &PL_sv_undef))
+ {
- /* If no swash, use the input nitialization string, if available */
+ /* If no swash, use the input initialization string, if available */
sv_catsv(matches_string, si);
}
SV*
Perl__get_swash_invlist(pTHX_ SV* const swash)
{
- SV** ptr = hv_fetchs(MUTABLE_HV(SvRV(swash)), "INVLIST", FALSE);
+ SV** ptr;
PERL_ARGS_ASSERT__GET_SWASH_INVLIST;
+ if (! SvROK(swash) || SvTYPE(SvRV(swash)) != SVt_PVHV) {
+ return NULL;
+ }
+
+ ptr = hv_fetchs(MUTABLE_HV(SvRV(swash)), "INVLIST", FALSE);
+
if (! ptr) {
return NULL;
}