This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix [perl #71078] Smart match against @_ gives false negatives
[perl5.git] / pp_ctl.c
index e69107e..68a42d7 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -4321,7 +4321,8 @@ S_do_smartmatch(pTHX_ HV *seen_this, HV *seen_other)
                    SV * const * const other_elem = av_fetch(other_av, i, FALSE);
 
                    if (!this_elem || !other_elem) {
-                       if (this_elem || other_elem)
+                       if ((this_elem && SvOK(*this_elem))
+                               || (other_elem && SvOK(*other_elem)))
                            RETPUSHNO;
                    }
                    else if (hv_exists_ent(seen_this,