This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Refactor newATTRSUB()'s logic for grafting a sub definition to an existing stub
authorNicholas Clark <nick@ccl4.org>
Thu, 18 Nov 2010 14:54:44 +0000 (14:54 +0000)
committerNicholas Clark <nick@ccl4.org>
Thu, 18 Nov 2010 15:00:44 +0000 (15:00 +0000)
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.


No differences found