This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pad.c:pad_reset: Also make sure the thing is not PADMY
authorFather Chrysostomos <sprout@cpan.org>
Tue, 26 Aug 2014 15:31:22 +0000 (08:31 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 28 Aug 2014 20:04:16 +0000 (13:04 -0700)
We can’t SvPADTMP_off on just anything, because it asserts that the
thing is !SvPADMY.

A range operator has a target of sorts, but that target must not be
shared with any other operators; hence it gets allocated like a
‘my’ variable.  The target thus ends up with the SvPADMY flag set.  We
obviously don’t want to mark those targets as reusable in pad_reset,
so just skip them.

This gets things mostly working under USE_BROKEN_PAD_RESET without
threads, but a few tests still fail.

pad.c

diff --git a/pad.c b/pad.c
index acbaae1..3a79206 100644 (file)
--- a/pad.c
+++ b/pad.c
@@ -1661,6 +1661,7 @@ S_pad_reset(pTHX)
         I32 po;
        for (po = AvMAX(PL_comppad); po > PL_padix_floor; po--) {
            if (PL_curpad[po] && !SvIMMORTAL(PL_curpad[po])
+            && !SvPADMY(PL_curpad[po])
             && (  PadnamelistMAX(PL_comppad_name) < po
                || !PadnamelistARRAY(PL_comppad_name)[po]
                || !PadnameLEN(PadnamelistARRAY(PL_comppad_name)[po]) ))