This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
simplify the return code in (??{})
[perl5.git] / regexec.c
index 0969379..9155de8 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -4443,20 +4443,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog)
                    } else if (SvTYPE(ret) == SVt_REGEXP) {
                        rx = (REGEXP*) ret;
                    } else if (SvSMAGICAL(ret)) {
-                       if (SvGMAGICAL(ret)) {
-                           /* I don't believe that there is ever qr magic
-                              here.  */
-                           assert(!mg_find(ret, PERL_MAGIC_qr));
-                           sv_unmagic(ret, PERL_MAGIC_qr);
-                       }
-                       else {
-                           mg = mg_find(ret, PERL_MAGIC_qr);
-                           /* testing suggests mg only ends up non-NULL for
-                              scalars who were upgraded and compiled in the
-                              else block below. In turn, this is only
-                              triggered in the "postponed utf8 string" tests
-                              in t/op/pat.t  */
-                       }
+                       mg = mg_find(ret, PERL_MAGIC_qr);
                    }
 
                    if (mg) {