Skip to content

Commit

Permalink
Remove pointless use-after-free assert
Browse files Browse the repository at this point in the history
While op_free() doesn't actually free the op, but adds it to the
slab's freelist and marks it as freed, that's not obvious when reading
the code. Also, if op_free() fails to do its job, we have bigger
problems than just here.
  • Loading branch information
ilmari committed Sep 19, 2023
1 parent ee5597d commit ea05091
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion class.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,6 @@ Perl_class_seal_stash(pTHX_ HV *stash)
/* have to clear the OPf_KIDS flag or op_free() will get upset */
valop->op_flags &= ~OPf_KIDS;
op_free(valop);
assert(valop->op_type == OP_FREED);

OP *fieldcop = o;
assert(fieldcop->op_type == OP_NEXTSTATE || fieldcop->op_type == OP_DBSTATE);
Expand Down

0 comments on commit ea05091

Please sign in to comment.