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

[perl #109542] $1 handled differently in integer arithmetics

Thread Previous | Thread Next
Father Chrysostomos via RT
June 7, 2012 08:34
[perl #109542] $1 handled differently in integer arithmetics
Message ID:
On Wed Feb 01 13:39:05 2012, sprout wrote:
> On Wed Feb 01 13:01:39 2012, wrote:
> > At 2012-02-01 12:35:00 -0800, wrote:
> > >
> > > But in the case of SvIV_please_nomg, we have already called magic (the
> > > whole raison d’être for the _nomg variant), so there is no reason not
> > > to treat SvPOKp as equivalent to SvPOK.
> > > 
> > > Does that sound right?
> > 
> > It sounds right in principle, but it's not clear to me how to translate
> > that into a fix. In how many more places is that equivalence relevant,
> > and where must we add "|| SvPOKp(sv)"s to let them all through? Doing
> > it only in SvIV_please_nomg is insufficient. Or is there some easier
> > way to do it? Comments gratefully received.
> But how much other code is affected?  It is just the numeric ops?  It
> looks as though this will require what I call a bug hunt: grepping for
> instances and examining them for correctness.

I did ‘ack -n '^(?=.*\bSvPOK\b)(?!.*\bSvPOKp\b)'’ and then examined each

You can see the results of my bug hunt in the branch that was merged
into blead with commit f2ab049418.

This ticket bug, involving numeric ops and $1, was more complicated than
simply using SvPOKp in SvIV_please_nomg.  All the code that used the
latter macro followed it with if(SvIOK(sv)), so I had to change
SvIV_please_nomg to return a boolean.  Also, the gmagic handling wasn’t
so simple after all.

It was commit 01f91bf275 that fixed this particular bug.


Father Chrysostomos

via perlbug:  queue: perl5 status: open

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About