summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorVincent Pit <perl@profvince.com>2011-06-27 15:01:30 +0200
committerVincent Pit <perl@profvince.com>2011-06-27 15:01:34 +0200
commit7c2d9d03f8b64a80661ece16e7bfc15456ae3400 (patch)
tree42352760a6536d35f091b115272e8525f2731811 /op.c
parentfa22d357d948ce8e179d9c7a461076497fc9681e (diff)
downloadperl-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 'op.c')
-rw-r--r--op.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/op.c b/op.c
index cbc44b835c..6b4bf6b284 100644
--- a/op.c
+++ b/op.c
@@ -8219,19 +8219,6 @@ Perl_ck_return(pTHX_ OP *o)
if (CvLVALUE(PL_compcv)) {
for (; kid; kid = kid->op_sibling)
op_lvalue(kid, OP_LEAVESUBLV);
- } else {
- for (; kid; kid = kid->op_sibling)
- if ((kid->op_type == OP_NULL)
- && ((kid->op_flags & (OPf_SPECIAL|OPf_KIDS)) == (OPf_SPECIAL|OPf_KIDS))) {
- /* This is a do block */
- OP *op = kUNOP->op_first;
- if (op->op_type == OP_LEAVE && op->op_flags & OPf_KIDS) {
- op = cUNOPx(op)->op_first;
- assert(op->op_type == OP_ENTER && !(op->op_flags & OPf_SPECIAL));
- /* Force the use of the caller's context */
- op->op_flags |= OPf_SPECIAL;
- }
- }
}
return o;