diff options
author | Vincent Pit <perl@profvince.com> | 2011-06-27 15:01:30 +0200 |
---|---|---|
committer | Vincent Pit <perl@profvince.com> | 2011-06-27 15:01:34 +0200 |
commit | 7c2d9d03f8b64a80661ece16e7bfc15456ae3400 (patch) | |
tree | 42352760a6536d35f091b115272e8525f2731811 /pp_ctl.c | |
parent | fa22d357d948ce8e179d9c7a461076497fc9681e (diff) | |
download | perl-7c2d9d03f8b64a80661ece16e7bfc15456ae3400.tar.gz |
Fix context propagation below return()
A.k.a. "RT #38809 strikes back".
Back in the time of perl 5.003, there was no void context, so "do" blocks
below a return needed special handling to use the dynamic context of the
caller instead of the static context implied by the return op location.
But nowadays context is applied by the scalarvoid(), scalar() and list()
functions, and they all already skip the return ops. "do" blocks below a
return don't get a static context, and GIMME_V ought to correctly return
the caller's context. The old workaround isn't even required anymore.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 13 |
1 files changed, 1 insertions, 12 deletions
@@ -2087,18 +2087,7 @@ PP(pp_enter) { dVAR; dSP; register PERL_CONTEXT *cx; - I32 gimme = OP_GIMME(PL_op, -1); - - if (gimme == -1) { - if (cxstack_ix >= 0) { - /* If this flag is set, we're just inside a return, so we should - * store the caller's context */ - gimme = (PL_op->op_flags & OPf_SPECIAL) - ? block_gimme() - : cxstack[cxstack_ix].blk_gimme; - } else - gimme = G_SCALAR; - } + I32 gimme = GIMME_V; ENTER_with_name("block"); |