Upgrade to Encode 2.08.
[p5sagit/p5-mst-13.2.git] / pp.c
diff --git a/pp.c b/pp.c
index 2b38805..94a278a 100644 (file)
--- a/pp.c
+++ b/pp.c
  * and no knowing what you'll find around a corner.  And Elves, sir!" --Samwise
  */
 
+/* This file contains general pp ("push/pop") functions that execute the
+ * opcodes that make up a perl program. A typical pp function expects to
+ * find its arguments on the stack, and usually pushes its results onto
+ * the stack, hence the 'pp' terminology. Each OP structure contains
+ * a pointer to the relevant pp_foo() function.
+ */
+
 #include "EXTERN.h"
 #define PERL_IN_PP_C
 #include "perl.h"
@@ -152,6 +159,8 @@ PP(pp_rv2gv)
                /* If this is a 'my' scalar and flag is set then vivify
                 * NI-S 1999/05/07
                 */
+               if (SvREADONLY(sv))
+                   Perl_croak(aTHX_ PL_no_modify);
                if (PL_op->op_private & OPpDEREF) {
                    char *name;
                    GV *gv;
@@ -169,7 +178,7 @@ PP(pp_rv2gv)
                    if (SvTYPE(sv) < SVt_RV)
                        sv_upgrade(sv, SVt_RV);
                    if (SvPVX(sv)) {
-                       (void)SvOOK_off(sv);            /* backoff */
+                       SvOOK_off(sv);          /* backoff */
                        if (SvLEN(sv))
                            Safefree(SvPVX(sv));
                        SvLEN(sv)=SvCUR(sv)=0;
@@ -821,12 +830,12 @@ PP(pp_undef)
        break;
     default:
        if (SvTYPE(sv) >= SVt_PV && SvPVX(sv) && SvLEN(sv)) {
-           (void)SvOOK_off(sv);
+           SvOOK_off(sv);
            Safefree(SvPVX(sv));
            SvPV_set(sv, Nullch);
            SvLEN_set(sv, 0);
        }
-       (void)SvOK_off(sv);
+       SvOK_off(sv);
        SvSETMAGIC(sv);
     }
 
@@ -3134,7 +3143,7 @@ PP(pp_substr)
                sv_magic(TARG, Nullsv, PERL_MAGIC_substr, Nullch, 0);
            }
            else
-               (void)SvOK_off(TARG);
+               SvOK_off(TARG);
 
            LvTYPE(TARG) = 'x';
            if (LvTARG(TARG) != sv) {