better VMS docs for $?, exit(), and system()
[p5sagit/p5-mst-13.2.git] / pp.c
diff --git a/pp.c b/pp.c
index 6d393bd..1cb3a44 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -467,8 +467,8 @@ S_refto(pTHX_ SV *sv)
        SvTEMP_off(sv);
        (void)SvREFCNT_inc(sv);
     }
-    else if (SvPADTMP(sv))
-       sv = newSVsv(sv);
+    else if (SvPADTMP(sv) && !IS_PADGV(sv))
+        sv = newSVsv(sv);
     else {
        SvTEMP_off(sv);
        (void)SvREFCNT_inc(sv);
@@ -943,7 +943,7 @@ PP(pp_multiply)
                    /* 2s complement assumption that (UV)-IV_MIN is correct.  */
                    /* -ve result, which could overflow an IV  */
                    SP--;
-                   SETi( -product );
+                   SETi( -(IV)product );
                    RETURN;
                } /* else drop to NVs below. */
            } else {
@@ -980,7 +980,7 @@ PP(pp_multiply)
                            /* 2s complement assumption again  */
                            /* -ve result, which could overflow an IV  */
                            SP--;
-                           SETi( -product_low );
+                           SETi( -(IV)product_low );
                            RETURN;
                        } /* else drop to NVs below. */
                    }
@@ -4042,7 +4042,7 @@ PP(pp_split)
 #endif
     if (!pm || !s)
        DIE(aTHX_ "panic: pp_split");
-    rx = pm->op_pmregexp;
+    rx = PM_GETRE(pm);
 
     TAINT_IF((pm->op_pmflags & PMf_LOCALE) &&
             (pm->op_pmflags & (PMf_WHITE | PMf_SKIPWHITE)));
@@ -4228,12 +4228,16 @@ PP(pp_split)
                for (i = 1; i <= rx->nparens; i++) {
                    s = rx->startp[i] + orig;
                    m = rx->endp[i] + orig;
-                   if (m && s) {
+
+                   /* japhy (07/27/01) -- the (m && s) test doesn't catch
+                      parens that didn't match -- they should be set to
+                      undef, not the empty string */
+                   if (m >= orig && s >= orig) {
                        dstr = NEWSV(33, m-s);
                        sv_setpvn(dstr, s, m-s);
                    }
                    else
-                       dstr = NEWSV(33, 0);
+                       dstr = &PL_sv_undef;  /* undef, not "" */
                    if (make_mortal)
                        sv_2mortal(dstr);
                    if (do_utf8)
@@ -4325,7 +4329,7 @@ Perl_unlock_condpair(pTHX_ void *svv)
     MgOWNER(mg) = 0;
     COND_SIGNAL(MgOWNERCONDP(mg));
     DEBUG_S(PerlIO_printf(Perl_debug_log, "0x%"UVxf": unlock 0x%"UVxf"\n",
-                         PTR2UV(thr), PTR2UV(svv));)
+                         PTR2UV(thr), PTR2UV(svv)));
     MUTEX_UNLOCK(MgMUTEXP(mg));
 }
 #endif /* USE_THREADS */