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
Father Chrysostomos via RT
September 11, 2012 21:40
[perl #114690] Bleadperl v5.17.3-204-g864329c breaks VPIT/Variable-Magic-0.51.tar.gz
Message ID:
On Tue Sep 11 20:36:54 2012, sprout wrote:
> On Mon Sep 10 15:31:28 2012, 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

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