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 f4ab8bd
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion class.c
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 f4ab8bd

Please sign in to comment.