diff options
author | Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> | 2023-02-05 11:31:14 +0000 |
---|---|---|
committer | Paul Evans <leonerd@leonerd.org.uk> | 2023-02-07 10:47:05 +0000 |
commit | aa2d00d7d06d0ec6110c4351b635728dfa53bc81 (patch) | |
tree | 791676fa28384e0ff9f701beeca8f1afb94b641a | |
parent | 83ba55794efd51e7a10531c7e50a859fe310ffb0 (diff) | |
download | perl-aa2d00d7d06d0ec6110c4351b635728dfa53bc81.tar.gz |
Also add a note to the docs of op_free() to remind users about clearing the OPf_KIDS flag
-rw-r--r-- | op.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -849,6 +849,15 @@ S_op_destroy(pTHX_ OP *o) Free an op and its children. Only use this when an op is no longer linked to from any optree. +Remember that any op with C<OPf_KIDS> set is expected to have a valid +C<op_first> pointer. If you are attempting to free an op but preserve its +child op, make sure to clear that flag before calling C<op_free()>. For +example: + + OP *kid = o->op_first; o->op_first = NULL; + o->op_flags &= ~OPf_KIDS; + op_free(o); + =cut */ |