summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2005-05-21 19:15:43 +0000
committerDave Mitchell <davem@fdisolutions.com>2005-05-21 19:15:43 +0000
commitc74ace89800a81a764294e9f6eacc04bbed5a568 (patch)
tree1fa600f949acceb545ad4aa08ff06095f971c8bd /pp_ctl.c
parent7b2c381cf37e4e4611c4a864b5d6f7134344e3e6 (diff)
downloadperl-c74ace89800a81a764294e9f6eacc04bbed5a568.tar.gz
disallow eval { goto &foo }
eval 'goto &foo' is already banned, and the try-version usually coredumps due to the code assuming the CxEVAL is actually a CxSUB. Anyway exiting an eval but preserving "it's" @_ doesn't make much sense. p4raw-id: //depot/perl@24532
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index ae25cc60f0..4dc004625e 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2297,8 +2297,11 @@ PP(pp_goto)
if (cxix < cxstack_ix)
dounwind(cxix);
TOPBLOCK(cx);
- if (CxREALEVAL(cx))
- DIE(aTHX_ "Can't goto subroutine from an eval-string");
+ if (CxTYPE(cx) == CXt_EVAL)
+ if (CxREALEVAL(cx))
+ DIE(aTHX_ "Can't goto subroutine from an eval-string");
+ else
+ DIE(aTHX_ "Can't goto subroutine from an eval-block");
if (CxTYPE(cx) == CXt_SUB && cx->blk_sub.hasargs) {
/* put @_ back onto stack */
AV* av = cx->blk_sub.argarray;