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

[perl #119481] SvVALID does not check SVpad_OUR

Thread Next
From:
Reini Urban via RT
Date:
August 27, 2013 17:00
Subject:
[perl #119481] SvVALID does not check SVpad_OUR
Message ID:
rt-3.6.HEAD-1873-1377622793-1102.119481-15-0@perl.org

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



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

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