invalid cop_free of nullified cop. How to fix?
Reini Urban [Tue, 15 Apr 2008 14:09:11 +0000 (16:09 +0200)]
From: "Reini Urban" <rurban@x-ray.at>
Message-ID: <6910a60804150509j3c100fc4t2ed303ae0124ba15@mail.gmail.com>

p4raw-id: //depot/perl@33687

op.c

diff --git a/op.c b/op.c
index 21aa23d..6823cc9 100644 (file)
--- a/op.c
+++ b/op.c
@@ -495,8 +495,6 @@ Perl_op_free(pTHX_ OP *o)
            op_free(kid);
        }
     }
-    if (type == OP_NULL)
-       type = (OPCODE)o->op_targ;
 
 #ifdef PERL_DEBUG_READONLY_OPS
     Slab_to_rw(o);
@@ -508,6 +506,9 @@ Perl_op_free(pTHX_ OP *o)
        cop_free((COP*)o);
     }
 
+    if (type == OP_NULL)
+       type = (OPCODE)o->op_targ;
+
     op_clear(o);
     if (o->op_latefree) {
        o->op_latefreed = 1;