summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pod/perldelta.pod9
-rw-r--r--pp_ctl.c1
-rw-r--r--t/op/coresubs.t7
3 files changed, 17 insertions, 0 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 8b0950044a..7b79df8b10 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -809,6 +809,15 @@ variable [perl #98662].
C<++> and C<--> now work on copies of globs, instead of dying.
+=item *
+
+The subroutines in the CORE:: namespace that were introduced in the
+previous development release run with the lexical hints (strict, warnings)
+of the caller, just as though the built-in function had been called. But
+this was not the case for C<goto &CORE::sub>. The CORE sub would end up
+running with the lexical hints of the subroutine it replaced, instead of
+that subroutine's caller. This has been fixed.
+
=back
=head1 Known Problems
diff --git a/pp_ctl.c b/pp_ctl.c
index e8907b6751..603d0a5782 100644
--- 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)
diff --git a/t/op/coresubs.t b/t/op/coresubs.t
index f0ebe8ed5b..b3dd3ceba6 100644
--- a/t/op/coresubs.t
+++ b/t/op/coresubs.t
@@ -108,6 +108,13 @@ while(<$kh>) {
}
}
+$tests++;
+# This subroutine is outside the warnings scope:
+sub foo { goto &CORE::abs }
+use warnings;
+$SIG{__WARN__} = sub { like shift, qr\^Use of uninitialized\ };
+foo(undef);
+
is curr_test, $tests+1, 'right number of tests';
done_testing;