diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2005-05-21 19:15:43 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2005-05-21 19:15:43 +0000 |
commit | c74ace89800a81a764294e9f6eacc04bbed5a568 (patch) | |
tree | 1fa600f949acceb545ad4aa08ff06095f971c8bd /pp_ctl.c | |
parent | 7b2c381cf37e4e4611c4a864b5d6f7134344e3e6 (diff) | |
download | perl-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.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; |