summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2014-09-05 17:12:27 +0100
committerDavid Mitchell <davem@iabyn.com>2014-09-10 14:25:05 +0100
commitd0c8136d16b18be562680c1f71b02490218427f2 (patch)
treea0de075f9bba864fd6532819fbaa5ea4a8ac7670 /op.c
parent0ef96805f64e8a30fc79019cea63b653fd0a61e9 (diff)
downloadperl-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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/op.c b/op.c
index 59fe2cb717..ef6b3b7f03 100644
--- a/op.c
+++ b/op.c
@@ -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: