This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove false statement about Unicode strings
[perl5.git] / pp.c
diff --git a/pp.c b/pp.c
index daa63af..2c5f69a 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -207,7 +207,7 @@ PP(pp_rv2gv)
            }
            else {
                if (PL_op->op_private & HINT_STRICT_REFS)
-                   DIE(aTHX_ S_no_symref_sv, sv, (SvCUR(sv)>32 ? "..." : ""), "a symbol");
+                   DIE(aTHX_ S_no_symref_sv, sv, (SvPOK(sv) && SvCUR(sv)>32 ? "..." : ""), "a symbol");
                if ((PL_op->op_private & (OPpLVAL_INTRO|OPpDONT_INIT_GV))
                    == OPpDONT_INIT_GV) {
                    /* We are the target of a coderef assignment.  Return
@@ -237,7 +237,7 @@ Perl_softref2xv(pTHX_ SV *const sv, const char *const what,
 
     if (PL_op->op_private & HINT_STRICT_REFS) {
        if (SvOK(sv))
-           Perl_die(aTHX_ S_no_symref_sv, sv, (SvCUR(sv)>32 ? "..." : ""), what);
+           Perl_die(aTHX_ S_no_symref_sv, sv, (SvPOK(sv) && SvCUR(sv)>32 ? "..." : ""), what);
        else
            Perl_die(aTHX_ PL_no_usym, what);
     }
@@ -1030,7 +1030,7 @@ PP(pp_pow)
                           on same algorithm as above */
                        register UV result = 1;
                        register UV base = baseuv;
-                       const bool odd_power = (bool)(power & 1);
+                       const bool odd_power = cBOOL(power & 1);
                        if (odd_power) {
                            result *= base;
                        }
@@ -3439,6 +3439,7 @@ PP(pp_sprintf)
     dVAR; dSP; dMARK; dORIGMARK; dTARGET;
     if (SvTAINTED(MARK[1]))
        TAINT_PROPER("sprintf");
+    SvTAINTED_off(TARG);
     do_sprintf(TARG, SP-MARK, MARK+1);
     TAINT_IF(SvTAINTED(TARG));
     SP = ORIGMARK;
@@ -5418,12 +5419,15 @@ PP(pp_reverse)
            }
            else {
                SV **begin = AvARRAY(av);
-               SV **end   = begin + AvFILLp(av);
 
-               while (begin && begin < end) {
-                   register SV * const tmp = *begin;
-                   *begin++ = *end;
-                   *end--   = tmp;
+               if (begin) {
+                   SV **end   = begin + AvFILLp(av);
+
+                   while (begin < end) {
+                       register SV * const tmp = *begin;
+                       *begin++ = *end;
+                       *end--   = tmp;
+                   }
                }
            }
        }