Skip to content

Commit e32ff4e

Browse files
author
Father Chrysostomos
committed
pp_ctl.c: Remove PL_curcop assignment
This was added years ago in commit 7fb6a87. Now that save_re_context does nothing (and die_unwind no longer even calls it), we don’t need to assign to PL_curcop. In the case where it matters, that is, the implicit eval scope that require provides, the values of PL_curcop and oldcop should always be the same.
1 parent 1a419e6 commit e32ff4e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pp_ctl.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,9 @@ Perl_die_unwind(pTHX_ SV *msv)
16141614
SV *namesv;
16151615
PERL_CONTEXT *cx;
16161616
SV **newsp;
1617+
#ifdef DEBUGGING
16171618
COP *oldcop;
1619+
#endif DEBUGGING
16181620
JMPENV *restartjmpenv;
16191621
OP *restartop;
16201622

@@ -1631,7 +1633,9 @@ Perl_die_unwind(pTHX_ SV *msv)
16311633
}
16321634
POPEVAL(cx);
16331635
namesv = cx->blk_eval.old_namesv;
1636+
#ifdef DEBUGGING
16341637
oldcop = cx->blk_oldcop;
1638+
#endif DEBUGGING
16351639
restartjmpenv = cx->blk_eval.cur_top_env;
16361640
restartop = cx->blk_eval.retop;
16371641

@@ -1641,13 +1645,8 @@ Perl_die_unwind(pTHX_ SV *msv)
16411645

16421646
LEAVE;
16431647

1644-
/* LEAVE could clobber PL_curcop (see save_re_context())
1645-
* XXX it might be better to find a way to avoid messing with
1646-
* PL_curcop in save_re_context() instead, but this is a more
1647-
* minimal fix --GSAR */
1648-
PL_curcop = oldcop;
1649-
16501648
if (optype == OP_REQUIRE) {
1649+
assert (PL_curcop == oldcop);
16511650
(void)hv_store(GvHVn(PL_incgv),
16521651
SvPVX_const(namesv),
16531652
SvUTF8(namesv) ? -(I32)SvCUR(namesv) : (I32)SvCUR(namesv),

0 commit comments

Comments
 (0)