develooper Front page | perl.perl5.porters | Postings from October 2013

Re: Padlist NULL pointer?

Thread Previous | Thread Next
From:
Father Chrysostomos
Date:
October 30, 2013 13:00
Subject:
Re: Padlist NULL pointer?
Message ID:
20131030130051.10568.qmail@lists-nntp.develooper.com
Darin McBride wrote:
> I'm just looking for where a
> patch may be required to stop the seg fault.

Does this work?  I have not tested it yet.

diff -rup Coro-6.31-eL_b57-orig/Coro/State.xs Coro-6.31-eL_b57/Coro/State.xs
--- Coro-6.31-eL_b57-orig/Coro/State.xs2013-10-30 05:56:32.000000000 -0700
+++ Coro-6.31-eL_b57/Coro/State.xs2013-10-30 05:56:43.000000000 -0700
@@ -513,7 +513,7 @@ coro_derive_padlist (pTHX_ CV *cv)
   PADLIST *padlist = CvPADLIST (cv);
   PADLIST *newpadlist;
   PAD *newpad;
-  PADOFFSET const off = PadlistMAX (padlist) + 1;
+  PADOFFSET const off = CvDEPTH (cv) ? CvDEPTH (cv) + 1 : 2;
 
   newPADLIST(newpadlist);
 #if !PERL_VERSION_ATLEAST(5,15,3)

If you look in Coro’s Changes file, you will see this:

        - implement 5.17 compatibility by almost blindly applying a
          good-looking patch by Father Chrysostomos.

So it’s my fault, for submitting a faulty patch.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About