From: Gurusamy Sarathy Date: Sun, 8 Oct 2000 04:15:29 +0000 (+0000) Subject: save_re_context() could reset PL_curcop to freed memory, causing core X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7fb6a879cc94ae034ecf69734e284e8874705e16;p=p5sagit%2Fp5-mst-13.2.git save_re_context() could reset PL_curcop to freed memory, causing core dumps in code such as C p4raw-id: //depot/perl@7165 --- diff --git a/pp_ctl.c b/pp_ctl.c index c949e78..d69aaa8 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -1417,6 +1417,12 @@ Perl_die_where(pTHX_ char *message, STRLEN msglen) 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 = cx->blk_oldcop; + if (optype == OP_REQUIRE) { char* msg = SvPVx(ERRSV, n_a); DIE(aTHX_ "%sCompilation failed in require",