Fix a very small memory leak in op_free, by reserving the
Paul Johnson [Tue, 28 Jan 2003 14:13:09 +0000 (15:13 +0100)]
case op_seq == (U16)-1 for the compiler backend

Subject: Re: Freeing code
From: "Paul Johnson" <paul@pjcj.net>
Message-ID: <18918.193.134.254.145.1043759589.squirrel@wesley.pjcj.net>

p4raw-id: //depot/perl@18599

op.c

diff --git a/op.c b/op.c
index f693dfc..41bc9d0 100644 (file)
--- a/op.c
+++ b/op.c
@@ -6063,8 +6063,10 @@ Perl_peep(pTHX_ register OP *o)
     for (; o; o = o->op_next) {
        if (o->op_seq)
            break;
-       if (!PL_op_seqmax)
-           PL_op_seqmax++;
+        /* The special value -1 is used by the B::C compiler backend to indicate
+         * that an op is statically defined and should not be freed */
+       if (!PL_op_seqmax || PL_op_seqmax == (U16)-1)
+           PL_op_seqmax = 1;
        PL_op = o;
        switch (o->op_type) {
        case OP_SETSTATE: