/* don't allocate gwop here, as we may leak it if PL_parser->error_count > 0 */
if (o->op_flags & OPf_STACKED) {
- OP* k;
OP *firstkid = cLISTOPo->op_first->op_sibling;
kid = cUNOPx(firstkid)->op_first;
if (kid->op_type != OP_SCOPE && kid->op_type != OP_LEAVE)
return no_fh_allowed(o);
- if (o->op_flags & OPf_STACKED) {
- LINKLIST(kid);
- firstkid->op_next = kLISTOP->op_first;
- kid->op_next = 0; /* just disconnect the leave/scope */
- o->op_flags |= OPf_SPECIAL;
- }
- for (k = kid; k; k = k->op_next) {
- kid = k;
- }
+ LINKLIST(kid);
+ firstkid->op_next = kLISTOP->op_first;
NewOp(1101, gwop, 1, LOGOP);
kid->op_next = (OP*)gwop;
o->op_flags &= ~OPf_STACKED;
}
kid = cLISTOPo->op_first->op_sibling;
- if (!kid || !kid->op_sibling)
- return too_few_arguments_pv(o,OP_DESC(o), 0);
for (kid = kid->op_sibling; kid; kid = kid->op_sibling)
op_lvalue(kid, OP_GREPSTART);
if (kid->op_type == OP_SCOPE || kid->op_type == OP_LEAVE) {
LINKLIST(kid);
- if (kid->op_type == OP_SCOPE) {
- kid->op_next = 0;
- }
- else if (kid->op_type == OP_LEAVE) {
- OP *k;
+ if (kid->op_type == OP_LEAVE)
op_null(kid); /* wipe out leave */
- kid->op_next = kid;
-
- for (k = kLISTOP->op_first->op_next; k; k = k->op_next) {
- if (k->op_next == kid)
- k->op_next = 0;
- /* don't descend into loops */
- else if (k->op_type == OP_ENTERLOOP
- || k->op_type == OP_ENTERITER)
- {
- k = cLOOPx(k)->op_lastop;
- }
- }
- }
+ /* Prevent execution from escaping out of the sort block. */
+ kid->op_next = 0;
/* provide scalar context for comparison function/block */
kid = scalar(firstkid);