summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index a2dc38ee77..cb521b4bdb 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1533,6 +1533,15 @@ PP(pp_goto)
I32 items = 0;
I32 oldsave;
+ if (!CvROOT(cv) && !CvXSUB(cv)) {
+ if (CvGV(cv)) {
+ SV *tmpstr = sv_newmortal();
+ gv_efullname(tmpstr, CvGV(cv));
+ DIE("Goto undefined subroutine &%s",SvPVX(tmpstr));
+ }
+ DIE("Goto undefined subroutine");
+ }
+
/* First do some returnish stuff. */
cxix = dopoptosub(cxstack_ix);
if (cxix < 0)
@@ -1591,7 +1600,7 @@ PP(pp_goto)
GvENAME(CvGV(cv)));
if (CvDEPTH(cv) > AvFILL(padlist)) {
AV *newpad = newAV();
- AV *oldpad = (AV*)AvARRAY(svp[CvDEPTH(cv)-1]);
+ SV **oldpad = AvARRAY(svp[CvDEPTH(cv)-1]);
I32 ix = AvFILL((AV*)svp[1]);
svp = AvARRAY(svp[0]);
for ( ;ix > 0; ix--) {
@@ -1600,7 +1609,7 @@ PP(pp_goto)
if (SvFLAGS(svp[ix]) & SVf_FAKE) {
/* outer lexical? */
av_store(newpad, ix,
- SvREFCNT_inc(AvARRAY(oldpad)[ix]) );
+ SvREFCNT_inc(oldpad[ix]) );
}
else { /* our own lexical */
if (*name == '@')