develooper Front page | perl.perl5.porters | Postings from July 2012

[perl #77300] [META] Regressions introduced by refactoring

From:
Father Chrysostomos via RT
Date:
July 27, 2012 10:56
Subject:
[perl #77300] [META] Regressions introduced by refactoring
Message ID:
rt-3.6.HEAD-11172-1343411746-1581.77300-15-0@perl.org
This commit:

commit 437388a93114b1acbfb3a173dfa7aa2138fd8283
Author: Nicholas Clark <nick@ccl4.org>
Date:   Thu Nov 18 14:54:44 2010 +0000

    Refactor newATTRSUB()'s logic for grafting a sub definition to an
existing stub
    
    Previously it was using cv_undef() to (partially) free the target CV
(the
    pre-existing stub), before donating it the padlist and outside
pointers from
    the source CV (the definition, just compiled), and then freeing up
the remains
    of the source CV.
    
    Instead, explicitly exchange padlist and outside pointers,
explicitly assign
    other fields that need changing (file and stash), and assert that
various
    CvFLAGS are as we expect them.

causes this:

$ ./perl -Ilib -e '\&f; *bar = *f; eval "sub bar {}"'
Assertion failed: (CvGV(cv) == gv), function Perl_newATTRSUB_flags, file
op.c, line 7464.
Abort trap

(fixed by f6894bc8d44)

and this:

$ ./perl -Ilib -e '*f=sub{}; undef &f; *bar = *f; eval "sub bar {}"'
Assertion failed: (!CvWEAKOUTSIDE(cv)), function Perl_newATTRSUB_flags,
file op.c, line 7462.
Abort trap

(fixed by e52de15a297, although the assertion failure actually exposed
an earlier problem caused by 5c41a5fa918, which was a bug fix, not a
refactoring [see e52de15a297 for detail]).

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=77300



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