This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix a bug in the debugger tracing variables when one was eval'ing
[perl5.git] / scope.c
diff --git a/scope.c b/scope.c
index 8e40e8e..6a996ce 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -267,9 +267,7 @@ Perl_save_gp(pTHX_ GV *gv, I32 empty)
     SSPUSHINT(SAVEt_GP);
 
     if (empty) {
-       register GP *gp;
-
-       Newxz(gp, 1, GP);
+       GP *gp = Perl_newGP(aTHX_ gv);
 
        if (GvCVu(gv))
            PL_sub_generation++;        /* taking a method out of circulation */
@@ -277,15 +275,7 @@ Perl_save_gp(pTHX_ GV *gv, I32 empty)
            gp->gp_io = newIO();
            IoFLAGS(gp->gp_io) |= IOf_ARGV|IOf_START;
        }
-       GvGP(gv) = gp_ref(gp);
-#ifndef PERL_DONT_CREATE_GVSV
-       GvSV(gv) = newSV(0);
-#endif
-       GvLINE(gv) = CopLINE(PL_curcop);
-       /* XXX Ideally this cast would be replaced with a change to const char*
-          in the struct.  */
-       GvFILE(gv) = CopFILE(PL_curcop) ? CopFILE(PL_curcop) : (char *) "";
-       GvEGV(gv) = gv;
+       GvGP(gv) = gp;
     }
     else {
        gp_ref(GvGP(gv));
@@ -841,6 +831,10 @@ Perl_leave_scope(pTHX_ I32 base)
            i = SSPOPINT;
            PL_stack_sp = PL_stack_base + i;
            break;
+       case SAVEt_STACK_CXPOS:         /* blk_oldsp on context stack */
+           i = SSPOPINT;
+           cxstack[i].blk_oldsp = SSPOPINT;
+           break;
        case SAVEt_AELEM:               /* array element */
            value = (SV*)SSPOPPTR;
            i = SSPOPINT;
@@ -888,8 +882,8 @@ Perl_leave_scope(pTHX_ I32 base)
                GvHV(PL_hintgv) = NULL;
            }
            *(I32*)&PL_hints = (I32)SSPOPINT;
-           Perl_refcounted_he_free(aTHX_ PL_compiling.cop_hints);
-           PL_compiling.cop_hints = (struct refcounted_he *) SSPOPPTR;
+           Perl_refcounted_he_free(aTHX_ PL_compiling.cop_hints_hash);
+           PL_compiling.cop_hints_hash = (struct refcounted_he *) SSPOPPTR;
            if (PL_hints & HINT_LOCALIZE_HH) {
                SvREFCNT_dec((SV*)GvHV(PL_hintgv));
                GvHV(PL_hintgv) = (HV*)SSPOPPTR;
@@ -990,7 +984,7 @@ Perl_leave_scope(pTHX_ I32 base)
            if (!specialWARN(PL_compiling.cop_warnings))
                PerlMemShared_free(PL_compiling.cop_warnings);
 
-           PL_compiling.cop_warnings = ptr;
+           PL_compiling.cop_warnings = (STRLEN*)ptr;
            break;
        case SAVEt_RE_STATE:
            {
@@ -1079,12 +1073,10 @@ Perl_cx_dump(pTHX_ PERL_CONTEXT *cx)
                cx->blk_loop.label);
        PerlIO_printf(Perl_debug_log, "BLK_LOOP.RESETSP = %ld\n",
                (long)cx->blk_loop.resetsp);
-       PerlIO_printf(Perl_debug_log, "BLK_LOOP.REDO_OP = 0x%"UVxf"\n",
-               PTR2UV(cx->blk_loop.redo_op));
+       PerlIO_printf(Perl_debug_log, "BLK_LOOP.MY_OP = 0x%"UVxf"\n",
+               PTR2UV(cx->blk_loop.my_op));
        PerlIO_printf(Perl_debug_log, "BLK_LOOP.NEXT_OP = 0x%"UVxf"\n",
-               PTR2UV(cx->blk_loop.next_op));
-       PerlIO_printf(Perl_debug_log, "BLK_LOOP.LAST_OP = 0x%"UVxf"\n",
-               PTR2UV(cx->blk_loop.last_op));
+               PTR2UV(CX_LOOP_NEXTOP_GET(cx)));
        PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERIX = %ld\n",
                (long)cx->blk_loop.iterix);
        PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERARY = 0x%"UVxf"\n",