diff options
author | David Mitchell <davem@iabyn.com> | 2014-09-05 17:12:27 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2014-09-10 14:25:05 +0100 |
commit | d0c8136d16b18be562680c1f71b02490218427f2 (patch) | |
tree | a0de075f9bba864fd6532819fbaa5ea4a8ac7670 /op.c | |
parent | 0ef96805f64e8a30fc79019cea63b653fd0a61e9 (diff) | |
download | perl-d0c8136d16b18be562680c1f71b02490218427f2.tar.gz |
Assert valid op_private bits in op_free()
On debugging builds, when freeing an op, check that that there are
no bits set in op_private that we're not aware of (as defined by
PL_op_private_valid[[]).
If breakage is bisected to this commit, it either means that something
should be added to regen/op_private (if the op having that bit set is in
fact legitimate), or fixing the op generation code if not.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -725,6 +725,11 @@ Perl_op_free(pTHX_ OP *o) return; type = o->op_type; + + /* an op should only ever acquire op_private flags that we know about. + * If this fails, you may need to fix something in regen/op_private */ + assert(!(o->op_private & ~PL_op_private_valid[type])); + if (o->op_private & OPpREFCOUNTED) { switch (type) { case OP_LEAVESUB: |