This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #71806] perldb does not setup %dbline with the shebang option -d
[perl5.git] / pp.c
diff --git a/pp.c b/pp.c
index 31614ed..2ee6049 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -559,7 +559,6 @@ PP(pp_ref)
     dVAR; dSP; dTARGET;
     const char *pv;
     SV * const sv = POPs;
-    STRLEN len;
 
     if (sv)
        SvGETMAGIC(sv);
@@ -567,8 +566,8 @@ PP(pp_ref)
     if (!sv || !SvROK(sv))
        RETPUSHNO;
 
-    pv = sv_reftype_len(SvRV(sv),TRUE,&len);
-    PUSHp(pv, len);
+    pv = sv_reftype(SvRV(sv),TRUE);
+    PUSHp(pv, strlen(pv));
     RETURN;
 }
 
@@ -899,6 +898,8 @@ PP(pp_postinc)
     dVAR; dSP; dTARGET;
     if (SvTYPE(TOPs) >= SVt_PVAV || isGV_with_GP(TOPs))
        Perl_croak_no_modify(aTHX);
+    if (SvROK(TOPs))
+       TARG = sv_newmortal();
     sv_setsv(TARG, TOPs);
     if (!SvREADONLY(TOPs) && SvIOK_notUV(TOPs) && !SvNOK(TOPs) && !SvPOK(TOPs)
         && SvIVX(TOPs) != IV_MAX)
@@ -921,6 +922,8 @@ PP(pp_postdec)
     dVAR; dSP; dTARGET;
     if (SvTYPE(TOPs) >= SVt_PVAV || isGV_with_GP(TOPs))
        Perl_croak_no_modify(aTHX);
+    if (SvROK(TOPs))
+       TARG = sv_newmortal();
     sv_setsv(TARG, TOPs);
     if (!SvREADONLY(TOPs) && SvIOK_notUV(TOPs) && !SvNOK(TOPs) && !SvPOK(TOPs)
         && SvIVX(TOPs) != IV_MIN)