Change 32742 by [EMAIL PROTECTED] on 2007/12/27 17:22:06

        assert() that the sv_unmagic() in S_regmatch() is unneeded.
        Add a comment about the mg_find() that follows.

Affected files ...

... //depot/perl/regexec.c#550 edit

Differences ...

==== //depot/perl/regexec.c#550 (text) ====
Index: perl/regexec.c
--- perl/regexec.c#549~32740~   2007-12-27 05:46:46.000000000 -0800
+++ perl/regexec.c      2007-12-27 09:22:06.000000000 -0800
@@ -3713,10 +3713,20 @@
                    if(SvROK(ret) && SvSMAGICAL(sv = SvRV(ret)))
                        mg = mg_find(sv, PERL_MAGIC_qr);
                    else if (SvSMAGICAL(ret)) {
-                       if (SvGMAGICAL(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
+                       }
+                       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  */
+                       }
                    }
 
                    if (mg) {
End of Patch.

Reply via email to