PERL_STATIC_INLINE bool
S_aassign_common_vars(pTHX_ OP* o)
{
- OP *lastop = o;
OP *curop;
- for (curop = LINKLIST(o); curop != o; curop = LINKLIST(curop)) {
+ for (curop = cUNOPo->op_first; curop; curop=curop->op_sibling) {
if (PL_opargs[curop->op_type] & OA_DANGEROUS) {
if (curop->op_type == OP_GV) {
GV *gv = cGVOPx_gv(curop);
curop->op_type == OP_RV2AV ||
curop->op_type == OP_RV2HV ||
curop->op_type == OP_RV2GV) {
- if (lastop->op_type != OP_GV) /* funny deref? */
+ if (cUNOPx(curop)->op_first->op_type != OP_GV) /* funny deref? */
return TRUE;
}
else if (curop->op_type == OP_PUSHRE) {
else
return TRUE;
}
- lastop = curop;
+
+ if (curop->op_flags & OPf_KIDS) {
+ if (aassign_common_vars(curop))
+ return TRUE;
+ }
}
return FALSE;
}
PL_generation++;
if (aassign_common_vars(o))
o->op_private |= OPpASSIGN_COMMON;
+ LINKLIST(o);
}
if (right && right->op_type == OP_SPLIT && !PL_madskills) {
is("$x $y $z", "1 1 2");
}
{
- local $TODO = "AASSIGN_COMMON detection with logical operators";
+ # AASSIGN_COMMON detection with logical operators
my $true = 1;
our($x,$y,$z) = (1..3);
(our $y, our $z) = $true && ($x,$y);