Skip to content

Commit

Permalink
Add a comment explaining why setting expr op's parent to NULL is OK here
Browse files Browse the repository at this point in the history
  • Loading branch information
leonerd committed Nov 26, 2024
1 parent f3c6237 commit e69bc1f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions op.c
Original file line number Diff line number Diff line change
Expand Up @@ -9870,6 +9870,11 @@ Perl_newFOROP(pTHX_ I32 flags, OP *sv, OP *expr, OP *block, OP *cont)
expr = args;
}

/* expr's parent has currently been set to NULL, but that's OK. When
* it gets consumed by the LOOP* structure later to make the loop op
* itself this will get set correctly.
*/

iterpflags |= OPpITER_INDEXED;
}

Expand Down

0 comments on commit e69bc1f

Please sign in to comment.