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=114690Thread Previous | Thread Next