summaryrefslogtreecommitdiff
path: root/op.h
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2006-12-13 01:47:34 +0000
committerDave Mitchell <davem@fdisolutions.com>2006-12-13 01:47:34 +0000
commit670f3923755f0c152f1bbc2d0a205d2d07284748 (patch)
treed42b438c68d76a9ee818a4a30085cc0f2d3793a0 /op.h
parent30994c59813138744bd35d43a2330cafe5893149 (diff)
downloadperl-670f3923755f0c152f1bbc2d0a205d2d07284748.tar.gz
fix parser leaks caused by croaking while shifting or reducing
e.g. these no longer leak: eval q[my $x; local $x] while 1; eval q[$s = sub <> {}] while 1; p4raw-id: //depot/perl@29543
Diffstat (limited to 'op.h')
-rw-r--r--op.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/op.h b/op.h
index e3596b5b4d..5c12c77f0d 100644
--- a/op.h
+++ b/op.h
@@ -22,7 +22,11 @@
* op_static Whether or not the op is statically defined.
* This flag is used by the B::C compiler backend
* and indicates that the op should not be freed.
- * op_spare Five spare bits!
+ * op_latefree tell op_free() to clear this op (and free any kids)
+ * but not yet deallocate the struct. This means that
+ * the op may be safely op_free()d multiple times
+ * op_latefreed an op_latefree op has been op_free()d
+ * op_spare three spare bits!
* op_flags Flags common to all operations. See OPf_* below.
* op_private Flags peculiar to a particular operation (BUT,
* by default, set to the number of children until
@@ -54,7 +58,9 @@
unsigned op_type:9; \
unsigned op_opt:1; \
unsigned op_static:1; \
- unsigned op_spare:5; \
+ unsigned op_latefree:1; \
+ unsigned op_latefreed:1; \
+ unsigned op_spare:3; \
U8 op_flags; \
U8 op_private;
#endif