This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
POPEVAL: don't set optype
authorDavid Mitchell <davem@iabyn.com>
Thu, 15 Oct 2015 21:27:03 +0000 (22:27 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 3 Feb 2016 08:59:44 +0000 (08:59 +0000)
don't quietly set the local var optype; instead explicitly set it
in the couple of places its actually needed. This allows us to
get rid of a bunch of PERL_UNUSED_VAR(optype);

cop.h
pp_ctl.c

diff --git a/cop.h b/cop.h
index b79ae27..525f546 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -753,7 +753,6 @@ struct block_eval {
 #define POPEVAL(cx)                                                    \
     STMT_START {                                                       \
        PL_in_eval = CxOLD_IN_EVAL(cx);                                 \
-       optype = CxOLD_OP_TYPE(cx);                                     \
        PL_eval_root = cx->blk_eval.old_eval_root;                      \
        if (cx->blk_eval.cur_text && SvSCREAM(cx->blk_eval.cur_text))   \
            SvREFCNT_dec_NN(cx->blk_eval.cur_text);                     \
index 83082af..ec64a93 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1504,8 +1504,6 @@ S_dopoptowhen(pTHX_ I32 startingblock)
 void
 Perl_dounwind(pTHX_ I32 cxix)
 {
-    I32 optype;
-
     if (!PL_curstackinfo) /* can happen if die during thread cloning */
        return;
 
@@ -1550,7 +1548,6 @@ Perl_dounwind(pTHX_ I32 cxix)
        }
        cxstack_ix--;
     }
-    PERL_UNUSED_VAR(optype);
 }
 
 void
@@ -1672,6 +1669,7 @@ Perl_die_unwind(pTHX_ SV *msv)
 #endif
            restartjmpenv = cx->blk_eval.cur_top_env;
            restartop = cx->blk_eval.retop;
+            optype = CxOLD_OP_TYPE(cx);
             CX_POP(cx);
 
            if (optype == OP_REQUIRE) {
@@ -3426,13 +3424,9 @@ S_doeval(pTHX_ int gimme, CV* outside, U32 seq, HV *hh)
 
     if (yystatus || PL_parser->error_count || !PL_eval_root) {
        PERL_CONTEXT *cx;
-       I32 optype;                     /* Used by POPEVAL. */
-       SV *namesv;
+       SV *namesv = NULL;
         SV *errsv = NULL;
 
-       namesv = NULL;
-       PERL_UNUSED_VAR(optype);
-
        /* note that if yystatus == 3, then the EVAL CX block has already
         * been popped, and various vars restored */
        PL_op = saveop;
@@ -4295,6 +4289,7 @@ PP(pp_leaveeval)
     namesv = cx->blk_eval.old_namesv;
     retop = cx->blk_eval.retop;
     evalcv = cx->blk_eval.cv;
+    optype = CxOLD_OP_TYPE(cx);
     CX_POP(cx);
 
 
@@ -4329,14 +4324,12 @@ void
 Perl_delete_eval_scope(pTHX)
 {
     PERL_CONTEXT *cx;
-    I32 optype;
        
     cx = &cxstack[cxstack_ix];
     CX_LEAVE_SCOPE(cx);
     POPEVAL(cx);
     POPBLOCK(cx);
     CX_POP(cx);
-    PERL_UNUSED_VAR(optype);
 }
 
 /* Common-ish code salvaged from Perl_call_sv and pp_entertry, because it was
@@ -4374,7 +4367,6 @@ PP(pp_leavetry)
     SV **newsp;
     I32 gimme;
     PERL_CONTEXT *cx;
-    I32 optype;
     OP *retop;
 
     PERL_ASYNC_CHECK();
@@ -4393,7 +4385,6 @@ PP(pp_leavetry)
     POPBLOCK(cx);
     retop = cx->blk_eval.retop;
     CX_POP(cx);
-    PERL_UNUSED_VAR(optype);
 
     CLEAR_ERRSV();
     return retop;