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

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

Father Chrysostomos via RT
July 27, 2012 10:56
[perl #77300] [META] Regressions introduced by refactoring
Message ID:
This commit:

commit 437388a93114b1acbfb3a173dfa7aa2138fd8283
Author: Nicholas Clark <>
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
    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
    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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About