diff options
author | Vincent Pit <perl@profvince.com> | 2008-11-26 19:49:48 +0100 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2008-11-26 18:18:44 +0000 |
commit | 1c8a42233ec49324eba45ced7d5587186f2e1587 (patch) | |
tree | 803de9cc047daf20301bcd44c4ad4d1ea0a02cfc /op.c | |
parent | 412da0037cc4cde2474dfefc6fdc5bdf091f2e24 (diff) | |
download | perl-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.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -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; + } } } |