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

Re: Padlist NULL pointer?

Thread Previous | Thread Next
From:
Marc Lehmann
Date:
November 2, 2013 19:47
Subject:
Re: Padlist NULL pointer?
Message ID:
20131102194744.GA6705@schmorp.de
On Wed, Oct 30, 2013 at 06:26:10PM -0000, Father Chrysostomos <sprout@cpan.org> wrote:
> Yes, even my supposed correction is faulty. :-(
> Another try:

Just FYI, this is the soltuion I came up with:

   #if NEWPADAPI

     while (!PadlistARRAY (padlist)[off - 1])
       --off;

     Perl_pad_push (aTHX_ padlist, off);
     newpad = PadlistARRAY (padlist)[off];
     PadlistARRAY (padlist)[off] = 0;

   #else

(whole function at http://ue.tst.eu/985586a8864896a96e82695a49de6404.txt)

That passes my testsuite for 5.18 down to 5.8 (just like the old code...),
and I hope Darin can test it to see if it actually works.

I don't like the while loop, but I can't see how one can be avoided. I
wonder if I could just steal the pad at CvDEPTH + 1 by null'ing it.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp@schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\

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