summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorVincent Pit <perl@profvince.com>2008-11-26 19:49:48 +0100
committerSteve Peters <steve@fisharerojo.org>2008-11-26 18:18:44 +0000
commit1c8a42233ec49324eba45ced7d5587186f2e1587 (patch)
tree803de9cc047daf20301bcd44c4ad4d1ea0a02cfc /op.c
parent412da0037cc4cde2474dfefc6fdc5bdf091f2e24 (diff)
downloadperl-1c8a42233ec49324eba45ced7d5587186f2e1587.tar.gz
Addendum to bug #38809: fix assertion failure, more tests
Message-ID: <492D8C3C.1010003@profvince.com> p4raw-id: //depot/perl@34921
Diffstat (limited to 'op.c')
-rw-r--r--op.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/op.c b/op.c
index 9c278dfafc..990cf4bb34 100644
--- a/op.c
+++ b/op.c
@@ -7651,14 +7651,15 @@ Perl_ck_return(pTHX_ OP *o)
} else {
for (; kid; kid = kid->op_sibling)
if ((kid->op_type == OP_NULL)
- && (kid->op_flags & OPf_SPECIAL)) {
+ && ((kid->op_flags & (OPf_SPECIAL|OPf_KIDS)) == (OPf_SPECIAL|OPf_KIDS))) {
/* This is a do block */
- OP *op = cUNOPx(kid)->op_first;
- assert(op && (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;
+ 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;
+ }
}
}