This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
use blk_loop format for CXt_GIVEN
authorZefram <zefram@fysh.org>
Wed, 29 Nov 2017 14:12:51 +0000 (14:12 +0000)
committerZefram <zefram@fysh.org>
Wed, 29 Nov 2017 14:12:51 +0000 (14:12 +0000)
inline.h
pp_ctl.c
sv.c

index 2b0a23d..e00dd22 100644 (file)
--- a/inline.h
+++ b/inline.h
@@ -1657,8 +1657,8 @@ S_cx_pushgiven(pTHX_ PERL_CONTEXT *cx, SV *orig_defsv)
 {
     PERL_ARGS_ASSERT_CX_PUSHGIVEN;
 
-    cx->blk_givwhen.leave_op = cLOOP->op_lastop;
-    cx->blk_givwhen.defsv_save = orig_defsv;
+    cx->blk_loop.my_op = cLOOP;
+    cx->blk_loop.itersave = orig_defsv;
 }
 
 
@@ -1671,8 +1671,8 @@ S_cx_popgiven(pTHX_ PERL_CONTEXT *cx)
     assert(CxTYPE(cx) == CXt_GIVEN);
 
     sv = GvSV(PL_defgv);
-    GvSV(PL_defgv) = cx->blk_givwhen.defsv_save;
-    cx->blk_givwhen.defsv_save = NULL;
+    GvSV(PL_defgv) = cx->blk_loop.itersave;
+    cx->blk_loop.itersave = NULL;
     SvREFCNT_dec(sv);
 }
 
index a3ece51..e8fcd46 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -4709,8 +4709,8 @@ PP(pp_leavewhen)
     }
     else {
        PERL_ASYNC_CHECK();
-        assert(cx->blk_givwhen.leave_op->op_type == OP_LEAVEGIVEN);
-       return cx->blk_givwhen.leave_op;
+        assert(cx->blk_loop.my_op->op_nextop->op_type == OP_LEAVEGIVEN);
+       return cx->blk_loop.my_op->op_nextop;
     }
 }
 
@@ -4759,7 +4759,7 @@ PP(pp_break)
     cx = CX_CUR();
     PL_stack_sp = PL_stack_base + cx->blk_oldsp;
 
-    return cx->blk_givwhen.leave_op;
+    return cx->blk_loop.my_op->op_nextop;
 }
 
 static MAGIC *
diff --git a/sv.c b/sv.c
index bf0b153..33387ee 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -14639,8 +14639,8 @@ Perl_cx_dup(pTHX_ PERL_CONTEXT *cxs, I32 ix, I32 max, CLONE_PARAMS* param)
                                                     param);
                break;
            case CXt_GIVEN:
-               ncx->blk_givwhen.defsv_save =
-                                sv_dup_inc(ncx->blk_givwhen.defsv_save, param);
+               ncx->blk_loop.itersave =
+                                sv_dup_inc(ncx->blk_loop.itersave, param);
                break;
            case CXt_BLOCK:
            case CXt_NULL: