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

[perl #114690] Bleadperl v5.17.3-204-g864329c breaks VPIT/Variable-Magic-0.51.tar.gz

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
September 11, 2012 21:40
Subject:
[perl #114690] Bleadperl v5.17.3-204-g864329c breaks VPIT/Variable-Magic-0.51.tar.gz
Message ID:
rt-3.6.HEAD-11172-1347424838-1811.114690-15-0@perl.org
On Tue Sep 11 20:36:54 2012, sprout wrote:
> On Mon Sep 10 15:31:28 2012, perl@profvince.com wrote:
> > The test that started to fail with this commit does a substr() on an
> > unicode string that has get and len magic callbacks. Before the change
> > len magic was called, now it isn't anymore. Is this is the expected
> > behaviour after this change? I have no idea whatsoever on what is
> > supposed to be correct, but I'd like to double check so that nothing
> > bad
> > goes unnoticed.
> 
> I don’t fully understand len magic.  I think its purpose it to optimise
> the retrieval of the length, so whether it does or does not get called
> is likely to change willy-nilly over time.

I have just had a look at mg_length.  It falls back to get-magic
(indirectly via SvPV_const) in the absence of length magic.  So it seems
to me it is never correct for both mg_get and mg_length both to be
called for the same operation.

So you can go ahead change your tests.

In fact, since the mg_length may turn on the UTF8 flag, yet it does not
provide the pv, most uses of mg_length are probably wrong.

-- 

Father Chrysostomos


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

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