Currently this function asserts that its 'o' argument is non-VOID;
later when recursing an OP_LIST, it skips any kids which are VOID.
This commit changes it so that the assert becomes a return, and
OP_LIST doesn't check whether its kids are VOID.
Doing it this way makes it easier to shortly make Perl_op_lvalue_flags()
non-recursive.
The only functional difference is that on debugging builds,
Perl_op_lvalue_flags() will no longer fail an assert if inadvertently
called with a VOID op.
return o;
}
- assert( (o->op_flags & OPf_WANT) != OPf_WANT_VOID );
+ /* elements of a list might be in void context because the list is
+ in scalar context or because they are attribute sub calls */
+ if ((o->op_flags & OPf_WANT) == OPf_WANT_VOID)
+ return o;
if (type == OP_PRTF || type == OP_SPRINTF) type = OP_ENTERSUB;
case OP_LIST:
localize = 0;
for (kid = cLISTOPo->op_first; kid; kid = OpSIBLING(kid))
- /* elements might be in void context because the list is
- in scalar context or because they are attribute sub calls */
- if ( (kid->op_flags & OPf_WANT) != OPf_WANT_VOID )
- op_lvalue(kid, type);
+ op_lvalue(kid, type);
break;
case OP_COREARGS: