This was added years ago in commit
7fb6a879. 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.
SV *namesv;
PERL_CONTEXT *cx;
SV **newsp;
+#ifdef DEBUGGING
COP *oldcop;
+#endif DEBUGGING
JMPENV *restartjmpenv;
OP *restartop;
}
POPEVAL(cx);
namesv = cx->blk_eval.old_namesv;
+#ifdef DEBUGGING
oldcop = cx->blk_oldcop;
+#endif DEBUGGING
restartjmpenv = cx->blk_eval.cur_top_env;
restartop = cx->blk_eval.retop;
LEAVE;
- /* LEAVE could clobber PL_curcop (see save_re_context())
- * XXX it might be better to find a way to avoid messing with
- * PL_curcop in save_re_context() instead, but this is a more
- * minimal fix --GSAR */
- PL_curcop = oldcop;
-
if (optype == OP_REQUIRE) {
+ assert (PL_curcop == oldcop);
(void)hv_store(GvHVn(PL_incgv),
SvPVX_const(namesv),
SvUTF8(namesv) ? -(I32)SvCUR(namesv) : (I32)SvCUR(namesv),