Fix regexec.c so $^N and $+ are correctly updated so that they work properly inside...
[p5sagit/p5-mst-13.2.git] / universal.c
index b4f296b..7d1bd55 100644 (file)
@@ -158,10 +158,10 @@ Perl_sv_does(pTHX_ SV *sv, const char *name)
 
     PUSHMARK(SP);
     XPUSHs(sv);
-    XPUSHs(sv_2mortal(newSVpv(name, 0)));
+    mXPUSHs(newSVpv(name, 0));
     PUTBACK;
 
-    methodname = sv_2mortal(newSVpvs("isa"));
+    methodname = newSVpvs_flags("isa", SVs_TEMP);
     /* ugly hack: use the SvSCREAM flag so S_method_common
      * can figure out we're calling DOES() and not isa(),
      * and report eventual errors correctly. --rgs */
@@ -487,7 +487,7 @@ XS(XS_version_new)
        if ( strcmp(classname,"version") != 0 ) /* inherited new() */
            sv_bless(rv, gv_stashpv(classname, GV_ADD));
 
-       PUSHs(sv_2mortal(rv));
+       mPUSHs(rv);
        PUTBACK;
        return;
     }
@@ -510,7 +510,7 @@ XS(XS_version_stringify)
          else
               Perl_croak(aTHX_ "lobj is not of type version");
 
-         PUSHs(sv_2mortal(vstringify(lobj)));
+         mPUSHs(vstringify(lobj));
 
          PUTBACK;
          return;
@@ -534,7 +534,7 @@ XS(XS_version_numify)
          else
               Perl_croak(aTHX_ "lobj is not of type version");
 
-         PUSHs(sv_2mortal(vnumify(lobj)));
+         mPUSHs(vnumify(lobj));
 
          PUTBACK;
          return;
@@ -558,7 +558,7 @@ XS(XS_version_normal)
          else
               Perl_croak(aTHX_ "lobj is not of type version");
 
-         PUSHs(sv_2mortal(vnormal(lobj)));
+         mPUSHs(vnormal(lobj));
 
          PUTBACK;
          return;
@@ -603,7 +603,7 @@ XS(XS_version_vcmp)
                    rs = newSViv(vcmp(lobj,rvs));
               }
 
-              PUSHs(sv_2mortal(rs));
+              mPUSHs(rs);
          }
 
          PUTBACK;
@@ -622,7 +622,7 @@ XS(XS_version_boolean)
     if (sv_derived_from(ST(0), "version")) {
        SV * const lobj = SvRV(ST(0));
        SV * const rs = newSViv( vcmp(lobj,new_version(newSVpvs("0"))) );
-       PUSHs(sv_2mortal(rs));
+       mPUSHs(rs);
        PUTBACK;
        return;
     }
@@ -685,7 +685,7 @@ XS(XS_version_qv)
        }
        else
        {
-           PUSHs(sv_2mortal(new_version(ver)));
+           mPUSHs(new_version(ver));
        }
 
        PUTBACK;
@@ -943,7 +943,6 @@ XS(XS_PerlIO_get_layers)
        }
 
        if (gv && (io = GvIO(gv))) {
-            dTARGET;
             AV* const av = PerlIO_get_layers(aTHX_ input ?
                                        IoIFP(io) : IoOFP(io));
             I32 i;
@@ -987,7 +986,7 @@ XS(XS_PerlIO_get_layers)
                            const IV flags = SvIVX(*flgsvp);
 
                            if (flags & PERLIO_F_UTF8) {
-                                XPUSHs(sv_2mortal(newSVpvs("utf8")));
+                                XPUSHs(newSVpvs_flags("utf8", SVs_TEMP));
                                 nitem++;
                            }
                       }
@@ -1419,8 +1418,8 @@ XS(XS_Tie_Hash_NamedCapture_flags)
     if (items != 0)
         Perl_croak(aTHX_ "Usage: Tie::Hash::NamedCapture::flags()");
 
-       XPUSHs(sv_2mortal(newSVuv(RXapif_ONE)));
-       XPUSHs(sv_2mortal(newSVuv(RXapif_ALL)));
+       mXPUSHu(RXapif_ONE);
+       mXPUSHu(RXapif_ALL);
        PUTBACK;
        return;
 }