This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Hoist switch-local variables.
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 27 Nov 2014 16:52:56 +0000 (11:52 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Thu, 27 Nov 2014 16:54:02 +0000 (11:54 -0500)
Additionally, svp was shadowed.

(clang -Wunreachable-code)

scope.c

diff --git a/scope.c b/scope.c
index 8e13071..a1aa3f5 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -761,6 +761,9 @@ Perl_leave_scope(pTHX_ I32 base)
     /* Localise the effects of the TAINT_NOT inside the loop.  */
     bool was = TAINT_get;
 
+    I32 i;
+    SV *sv;
+
     ANY arg0, arg1, arg2;
 
     /* these initialisations are logically unnecessary, but they shut up
@@ -983,11 +986,6 @@ Perl_leave_scope(pTHX_ I32 base)
            Safefree(ARG0_PTR);
            break;
 
-        {
-          SV **svp;
-          I32 i;
-          SV *sv;
-
         case SAVEt_CLEARPADRANGE:
             i = (I32)((uv >> SAVE_TIGHT_SHIFT) & OPpPADRANGE_COUNTMASK);
            svp = &PL_curpad[uv >>
@@ -1107,7 +1105,6 @@ Perl_leave_scope(pTHX_ I32 base)
                 }
             }
            break;
-        }
        case SAVEt_DELETE:
            (void)hv_delete(ARG0_HV, ARG2_PV, ARG1_I32, G_DISCARD);
            SvREFCNT_dec(ARG0_HV);