This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make goto &CORE::sub use the right lexical scope
[perl5.git] / pp_ctl.c
index e8907b6..603d0a5 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2908,6 +2908,7 @@ PP(pp_goto)
                }
                cx->blk_sub.cv = cv;
                cx->blk_sub.olddepth = CvDEPTH(cv);
+               PL_curcop = cx->blk_oldcop;
 
                CvDEPTH(cv)++;
                if (CvDEPTH(cv) < 2)