Eliminate label from struct block_loop, as it can be accessed via
Nicholas Clark [Sun, 20 Jan 2008 20:40:38 +0000 (20:40 +0000)]
oldcop.

p4raw-id: //depot/perl@33015

cop.h
pp_ctl.c

diff --git a/cop.h b/cop.h
index 778ffac..f8b32f8 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -427,7 +427,6 @@ struct block_eval {
 
 /* loop context */
 struct block_loop {
-    char *     label;
     I32                resetsp;
     LOOP *     my_op;  /* My op, that contains redo, next and last ops.  */
     /* (except for non_ithreads we need to modify next_op in pp_ctl.c, hence
@@ -485,7 +484,7 @@ struct block_loop {
        else                                                            \
            cx->blk_loop.itersave = NULL;
 #endif
-#define CxLABEL(c)     (0 + (c)->blk_loop.label)
+#define CxLABEL(c)     (0 + (c)->blk_oldcop->cop_label)
 
 #ifdef USE_ITHREADS
 #  define PUSHLOOP_OP_NEXT             /* No need to do anything.  */
@@ -496,7 +495,6 @@ struct block_loop {
 #endif
 
 #define PUSHLOOP(cx, dat, s)                                           \
-       cx->blk_loop.label = PL_curcop->cop_label;                      \
        cx->blk_loop.resetsp = s - PL_stack_base;                       \
        cx->blk_loop.my_op = cLOOP;                                     \
        PUSHLOOP_OP_NEXT;                                               \
index c596fdb..d1b0877 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1257,9 +1257,9 @@ S_dopoptolabel(pTHX_ const char *label)
                return -1;
            break;
        case CXt_LOOP:
-           if ( !cx->blk_loop.label || strNE(label, cx->blk_loop.label) ) {
+           if ( !CxLABEL(cx) || strNE(label, CxLABEL(cx)) ) {
                DEBUG_l(Perl_deb(aTHX_ "(Skipping label #%ld %s)\n",
-                       (long)i, cx->blk_loop.label));
+                       (long)i, CxLABEL(cx)));
                continue;
            }
            DEBUG_l( Perl_deb(aTHX_ "(Found label #%ld %s)\n", (long)i, label));