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

[perl #119481] SvVALID does not check SVpad_OUR

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
August 27, 2013 19:52
Subject:
[perl #119481] SvVALID does not check SVpad_OUR
Message ID:
rt-3.6.HEAD-1873-1377633126-760.119481-15-0@perl.org
On Tue Aug 27 09:59:53 2013, rurban wrote:
> 
> On Tue Aug 27 08:27:30 2013, rurban@cpanel.net wrote:
> > It was safe to use B::PV->PVBM on strings, even when it was only a PV
> > without attached Boyer-Moore table, because B::PV->PVBM had a SvVALID
> >    check
> > on the sv.
> > But now the SVpad_NAME shares the same bit with SVpbm_VALID,
> > and SvPAD_OUR = SVpad_NAME|SVpad_OUR and more.
> > 
> > The SvVALID check misses to check for OUR and STATE and TYPED
> > pads.
> > 
> > #define SvPAD_TYPED_on(sv)	(SvFLAGS(sv) |= SVpad_NAME|SVpad_TYPED)
> > #define SvPAD_OUR_on(sv)	(SvFLAGS(sv) |= SVpad_NAME|SVpad_OUR)
> > #define SvPAD_STATE_on(sv)	(SvFLAGS(sv) |= SVpad_NAME|SVpad_STATE)
> > 
> > but
> > #define SvVALID(sv)		(SvFLAGS(sv) & SVpbm_VALID)
> 
> See attached patch

That patch modifies the definitions in sv.h, which isn’t going to help
you here, because B.xs only uses SvVALID when PERL_FBM_TABLE_OFFSET is
defined, which hasn’t been the case since before 5.16.

-- 

Father Chrysostomos


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

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