This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.c: Make unused parameter signal its status
[perl5.git] / pp.c
diff --git a/pp.c b/pp.c
index 4c0a5b3..33eac60 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -1671,8 +1671,9 @@ PP(pp_repeat)
     IV count;
     SV *sv;
     bool infnan = FALSE;
+    const U8 gimme = GIMME_V;
 
-    if (GIMME_V == G_ARRAY && PL_op->op_private & OPpREPEAT_DOLIST) {
+    if (gimme == G_ARRAY && PL_op->op_private & OPpREPEAT_DOLIST) {
        /* TODO: think of some way of doing list-repeat overloading ??? */
        sv = POPs;
        SvGETMAGIC(sv);
@@ -1736,7 +1737,7 @@ PP(pp_repeat)
                        "Negative repeat count does nothing");
     }
 
-    if (GIMME_V == G_ARRAY && PL_op->op_private & OPpREPEAT_DOLIST) {
+    if (gimme == G_ARRAY && PL_op->op_private & OPpREPEAT_DOLIST) {
        dMARK;
        const SSize_t items = SP - MARK;
        const U8 mod = PL_op->op_flags & OPf_MOD;
@@ -2529,7 +2530,7 @@ S_scomplement(pTHX_ SV *targ, SV *sv)
 
        if (SvUTF8(TARG)) {
             if (len && ! utf8_to_bytes(tmps, &len)) {
-                Perl_croak(aTHX_ fatal_above_ff_msg, PL_op_desc[PL_op->op_type]);
+                Perl_croak(aTHX_ FATAL_ABOVE_FF_MSG, PL_op_desc[PL_op->op_type]);
             }
             SvCUR(TARG) = len;
             SvUTF8_off(TARG);
@@ -3652,8 +3653,12 @@ PP(pp_crypt)
 #if defined(__GLIBC__) || defined(__EMX__)
        if (PL_reentrant_buffer->_crypt_struct_buffer) {
            PL_reentrant_buffer->_crypt_struct_buffer->initialized = 0;
-           /* work around glibc-2.2.5 bug */
+#if (defined(__GLIBC__) && __GLIBC__ == 2) && \
+    (defined(__GLIBC_MINOR__) && __GLIBC_MINOR__ >= 2 && __GLIBC_MINOR__ < 4)
+           /* work around glibc-2.2.5 bug, has been fixed at some
+            * time in glibc-2.3.X */
            PL_reentrant_buffer->_crypt_struct_buffer->current_saltbits = 0;
+#endif
        }
 #endif
     }
@@ -3726,6 +3731,7 @@ PP(pp_ucfirst)
     if (! slen) {   /* If empty */
        need = 1; /* still need a trailing NUL */
        ulen = 0;
+        *tmpbuf = '\0';
     }
     else if (DO_UTF8(source)) {        /* Is the source utf8? */
        doing_utf8 = TRUE;
@@ -5616,14 +5622,7 @@ PP(pp_reverse)
                        SV * const tmp = *begin;
                        *begin++ = *end;
                        *end--   = tmp;
-
-                        if (tmp && SvWEAKREF(tmp))
-                            sv_rvunweaken(tmp);
                    }
-
-                    /* make sure we catch the middle element */
-                    if (begin == end && *begin && SvWEAKREF(*begin))
-                        sv_rvunweaken(*begin);
                }
            }
        }