diff options
author | Vincent Pit <perl@profvince.com> | 2008-09-29 19:36:09 +0200 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2008-11-25 06:28:40 +0000 |
commit | e91684bfbb744fa7e8fdd1131386e3066e5e051b (patch) | |
tree | cd1d9a0d57870802834a2cdbdad6fa6650b79714 /pp_hot.c | |
parent | 74b7c41f0d2d50702adafc135b0d95ee7dd3b77f (diff) | |
download | perl-e91684bfbb744fa7e8fdd1131386e3066e5e051b.tar.gz |
[perl #38809] return do { } : take 3 (or 4...)
Message-ID: <48E0F5E9.4050805@profvince.com>
p4raw-id: //depot/perl@34907
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -1754,9 +1754,13 @@ PP(pp_enter) I32 gimme = OP_GIMME(PL_op, -1); if (gimme == -1) { - if (cxstack_ix >= 0) - gimme = cxstack[cxstack_ix].blk_gimme; - else + 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; } @@ -1865,13 +1869,7 @@ PP(pp_leave) POPBLOCK(cx,newpm); - gimme = OP_GIMME(PL_op, -1); - if (gimme == -1) { - if (cxstack_ix >= 0) - gimme = cxstack[cxstack_ix].blk_gimme; - else - gimme = G_SCALAR; - } + gimme = OP_GIMME(PL_op, (cxstack_ix >= 0) ? gimme : G_SCALAR); TAINT_NOT; if (gimme == G_VOID) |