summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pp_hot.c6
-rw-r--r--t/cmd/lexsub.t2
2 files changed, 5 insertions, 3 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 0d70dfc1f5..45c5eb7d68 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2625,8 +2625,12 @@ PP(pp_entersub)
SV* sub_name;
/* anonymous or undef'd function leaves us no recourse */
- if (CvANON(cv) || !(gv = CvGV(cv)))
+ if (CvANON(cv) || !(gv = CvGV(cv))) {
+ if (CvNAMED(cv))
+ DIE(aTHX_ "Undefined subroutine &%"HEKf" called",
+ HEKfARG(CvNAME_HEK(cv)));
DIE(aTHX_ "Undefined subroutine called");
+ }
/* autoloaded stub? */
if (cv != GvCV(gv)) {
diff --git a/t/cmd/lexsub.t b/t/cmd/lexsub.t
index e0289b1be8..de5db96949 100644
--- a/t/cmd/lexsub.t
+++ b/t/cmd/lexsub.t
@@ -132,9 +132,7 @@ is do foo(), 43, 'state sub falling out of scope (called via amper)';
}
44
}
-::on;
sb(1);
-::off;
sub sb2 { 43 }
state sub sb2;
sub sb2 {