summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-04-15 15:54:31 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-04-15 15:54:31 +0000
commitcc93af5fbd42046d3d6e19c3655b76edf6980b42 (patch)
tree5fba21b2d36d66f6d2cc91f21bc15535173941d2 /op.c
parente780cd349007c0f64ff926c118b4b7ef8d8f6df5 (diff)
downloadperl-cc93af5fbd42046d3d6e19c3655b76edf6980b42.tar.gz
Call cop_free on nullified cops too
(this is a followup to 33687) p4raw-id: //depot/perl@33695
Diffstat (limited to 'op.c')
-rw-r--r--op.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/op.c b/op.c
index 6823cc991e..ba9e2a5a9f 100644
--- a/op.c
+++ b/op.c
@@ -502,7 +502,10 @@ Perl_op_free(pTHX_ OP *o)
/* COP* is not cleared by op_clear() so that we may track line
* numbers etc even after null() */
- if (type == OP_NEXTSTATE || type == OP_DBSTATE) {
+ if (type == OP_NEXTSTATE || type == OP_DBSTATE
+ || (type == OP_NULL /* the COP might have been null'ed */
+ && ((OPCODE)o->op_targ == OP_NEXTSTATE
+ || (OPCODE)o->op_targ == OP_DBSTATE))) {
cop_free((COP*)o);
}